-
What will be the output of the following PHP code ?
<?php
$p = 2;
while ((--$p > ++$p) - 2)
{
print $p;
}
?>
-
- 0000000000........infinite time
- 2222222.........infinite time
- -2-2-2-2-2-2-2-2.......infinite time
- All of above
- None of these
Correct Option: B
(–$p > ++$p) evaluates to 2 but -2 makes it enters the loop and prints p which is 2.