Home / CSE / PHP - CS :: Operators and Expressions in php

CSE :: PHP - CS

  1. What will be the output of the following PHP code ?

    <?php

    $a = 5;$b = -7;$c =0;

    $d = ++$a && ++$b || ++$c;

    print $d;print $a;

    ?>

  2. A.

     16

    B.

     06

    C.

     15

    D.

     05


  3. What will be the output of the following PHP code ?

    <?php

    $var1 = 3;

    print $var = ++$var;

    ?>

  4. A.

     1

    B.

     0

    C.

     2

    D.

     3


  5. What will be the output of the following PHP code ?

    <?php

    $var1 = 3;

    print ++$var++;

    ?>

  6. A.

     3

    B.

     4

    C.

     5

    D.

     error


  7. What will be the output of the following PHP code ?

    <?php

    $i = 0; $j = 1; $k = 2;

    print !(($i + $k) < ($j - $k));

    ?>

  8. A.

     1

    B.

     true

    C.

     false

    D.

     0


  9. What will be the output of the following PHP code ?

    <?php

    $i = 0;$j = 1;$k = 2;

    print !(( + + $i + $j) > ($j - $k));

    ?>

  10. A.

     1

    B.

     no output

    C.

     error

    D.

     0


  11. What will be the output of the following PHP code ?

    <?php

    $i = 0;$j = 1;$k = 2;

    print (( + + $i + $j) >! ($j - $k));

    ?>

  12. A.

     1

    B.

     no output

    C.

     error

    D.

     0


  13. What will be the output of the following PHP code ?

    <?php

    $a = 0x6db7;

    print $a<<6;

    ?>

  14. A.

     1797568

    B.

     no output

    C.

     error

    D.

     0x6dc0


  15. What will be the output of the following PHP code ?

    <?php

    $a = 'a' ;

    print $a * 2;

    ?>

  16. A.

     192

    B.

     2

    C.

     error

    D.

     0


  17. What will be the output of the following PHP code ?

    <?php

    $a = '4' ;

    print + + $a;

    ?>

  18. A.

     no output

    B.

     error

    C.

     5

    D.

     0


  19. What will be the output of the following PHP code ?

    <?php

    $a = '12345';

    print "qwe{$a}rty";

    ?>

  20. A.

     qwe12345rty

    B.

     qwe{$a}rty

    C.

     error

    D.

     no output