PHP Operators


  1. What will be the output of the following PHP code ?
    <?php
    $m = 10; $n = 11; $s = 12;
    print !(($m + $s) < ($n - $s));
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    True is 1.


  1. What will be the output of the following PHP code ?
    <?php
    $n1 = 13;
    print ++$n++;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    First pre increment is done and the result is a number,thus post increment cannot be performed on it.



  1. What will be the output of the following PHP code ?
    <?php
    $n1 = 5;
    print $n = ++$n;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    $n = ++$n returns 1(success).


  1. What will be the output of the following PHP code ?
    <?php
    $p = 6; $q = -8; $r = 2;
    $s = ++$p && ++$q || ++$r;
    echo $s;
    echo $p;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    17



  1. What will be the output of the following PHP code ?
    <?php
    $v = 'Mania';
    echo "Inter$view";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Inter, because $v became $view, which is undefined.