?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$y = 2;
if ($y-- == ++$y)
{
echo $y;
}
?>
<?php
$y = 2;
if ($y-- == ++$y)
{
echo $y;
}
?>
Answer & Solution
Correct Answer:
Option
A
First $y = 2 is compared to and then decremented, then incremented and compared to $y = 2.
Join the Discussion
Login to post a comment or share your explanation.
Login