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

Follow the order of post and pre increments.



Your comments will be displayed only after manual approval.