?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<<php
for ($i == 2; ++$i == $i; ++$i)
print "In for loop ";
print "After loopn";
?>
<<php
for ($i == 2; ++$i == $i; ++$i)
print "In for loop ";
print "After loopn";
?>
Answer & Solution
Correct Answer:
Option
A
The loop never exits as the condition ++X == X is always satisfied,evaluated from right to left.
Join the Discussion
Login to post a comment or share your explanation.
Login