"> What will be the output of the following PHP code ?<?php$num

Home » PHP » PHP If Else/Else If Statement » Question
  1. What will be the output of the following PHP code ?
    <?php
    $num = 5;
    if ($num = $num&0)
    print $num ;
    else
    print "Else statement executed...";
    ?>
    1. True
    2. Error
    3. 5
    4. Else statement executed...
    5. None of these
Correct Option: D

num&0 is 0,thus evaluated to false.



Your comments will be displayed only after manual approval.