PHP - Loops
Find the error in this PHP code snippet:
for ($i = 0; $i < 3; $i++) {
for ($j = 0; $j < 3; $j++) {
if ($i == $j) {
break 3;
}
echo "$i,$j\n";
}
}Find the error in this PHP code snippet:
for ($i = 0; $i < 3; $i++) {
for ($j = 0; $j < 3; $j++) {
if ($i == $j) {
break 3;
}
echo "$i,$j\n";
}
}break 3; tries to break out of 3 loops, but only 2 exist, causing a fatal error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions