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

First case p is incremented after setting q to p.



Your comments will be displayed only after manual approval.