ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<<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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.