-
What will be the output of the following PHP code ?
<?php
$s = 2;
for (1; $s == 1; $s = 2)
{
print "In for loop statement executed...";
}
print "After for loop statement executed...\n";
?>
-
- After for loop statement executed...
- Error
- In for loop statement executed...
- Nothing
- None of these
Correct Option: A
The loop never exits as the condition ++s == s is always satisfied,evaluated from right to left.