ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.