Q90
What will be the output of the following PHP code ? ( y != y++)) echo y; ?>
A.
1
B.
0
AnswerC.
2
D.
no output
Answer: Option B
Solution
Answer: Option B
Solution:
–$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.