PHP - Loops
Identify the error in this PHP code snippet involving nested loops and break:
for ($a = 0; $a < 4; $a++) {
for ($b = 0; $b < 4; $b++) {
if ($b == 3) {
break 4;
}
echo "$a$b ";
}
}Identify the error in this PHP code snippet involving nested loops and break:
for ($a = 0; $a < 4; $a++) {
for ($b = 0; $b < 4; $b++) {
if ($b == 3) {
break 4;
}
echo "$a$b ";
}
}break 4; tries to break out of 4 loops, which do not exist.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions