PHP Operators


  1. What will be the output of the following PHP code ?
    <?php
    $num = '8' ;
    print + + $num;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The character is type casted to integer before multiplying.


  1. What will be the output of the following PHP code ?
    <?php
    $n = 'n' ;
    print $n * 8;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Characters cannot be multiplied.



  1. What will be the output of the following PHP code ?
    <?php
    $n = 0x6db7;
    print $n<<8;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The output is in decimal.


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









  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Negation of a number is 0.



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The equation outputs false .