?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = 2;
if ($a-- - --$a - $a)
print "hello";
else
print "hi";
?>
<?php
$a = 2;
if ($a-- - --$a - $a)
print "hello";
else
print "hi";
?>
Answer & Solution
Correct Answer:
Option
B
Computing the expression in the if clause,it sums upto to 2 which is a positive value.
Join the Discussion
Login to post a comment or share your explanation.
Login