PHP Control Structures (Loop)
What will be the output of the following PHP code ?
for ($i = 0; $i < 5; $i++) {
for ($j = $i; $j > 0; $i--)
print $i;
}

0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5
infinite loop
no output
0 1 2 3 4 5

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = array("hi", "hello", "bye");
for (;count($a) < 5;) {
if (count($a) == 3)
print $a;
}

no output
ArrayArrayArrayArrayArrayArray….infinitely
(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)…infinitely
hihellobyehihellobyehihellobyehihellobyehihellobyehihellobye…..infinitely

ANSWER DOWNLOAD EXAMIANS APP