ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.