Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $k = 5;
    if (--$k <> ($k != $k++))
    {
    echo $k;
    }
    ?>
    1. 0
    2. Error
    3. 55
    4. 5
    5. None of these
Correct Option: A

–$k == 5 is false but k is decremented, the xor gives true if only one of the operands are true, thus 1 xor 0 is true.



Your comments will be displayed only after manual approval.