PHP Operators


  1. What will be the output of the following PHP code ?
    <?php
    $n = 15;
    $n = $n + 12;
    echo $n++;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    Operator precedence followed,incremented after display.


  1. What will be the output of the following PHP code ?
    <?php
    $num = 20;
    $num = $num++ + 25;
    echo $num;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Operator precedence followed.



  1. What will be the output of the following PHP code ?
    <?php
    $num = 10;
    $num = ($num + 15)++;
    echo $num;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Operator ++ can be done only on variables.


  1. What will be the output of the following PHP code ?
    <?php
    $num = 10 + ++15;
    echo $num;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Operator ++ can be done only on variables.



  1. What will be the output of the following PHP code ?
    <?php
    echo 6 * 10 / 4 + 10;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Operator precedence order must be followed.