?
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 != $y++))
{
echo $y;
}
?>
<?php
$y = 2;
if (--$y <> ($y != $y++))
{
echo $y;
}
?>
Answer & Solution
Correct Answer:
Option
B
–$y == 2 is false but y is decremented, the xor gives true if only one of the operands are true, thus 1 xor 0 is true.
Join the Discussion
Login to post a comment or share your explanation.
Login