Q. What will be the output of the following PHP code ?
Code:
<?php
$n = 1;
while(++$n || --$n)
{
print $n;
}
?>
β
Correct Answer: (A)
2345678......infinite time
Explanation: As it is || operator the second expression is not evaluated and n is always incremented, in the first case to 1.