Discussion :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
$x = 1;
$y = 2;
if (++$x == $y++)
{
echo "true ", $y, $x;
}
?>
Answer : Option B
Explanation :
x is preincremented and y is post incremented thus both are 2 in the if condition, later y is incremented.
Be The First To Comment