Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 3;
    $q = 4;
    $r = $p++ + ++$q;
    echo $r;
    ?>
    1. Error
    2. 8
    3. 3
    4. 4
    5. None of these
Correct Option: B

Post increment of p is done after expression evaluation.



Your comments will be displayed only after manual approval.