?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?phpspan>
$i = 0;
while(?++$i || --$i)
{
print $i;
}
?>
<?phpspan>
$i = 0;
while(?++$i || --$i)
{
print $i;
}
?>
Answer & Solution
Correct Answer:
Option
A
As it is || operator the second expression is not evaluated and i is always incremented, in the first case to 1.
Join the Discussion
Login to post a comment or share your explanation.
Login