Home »
MCQs »
PHP MCQs
What will be the output of the following PHP code (20)?
87. What will be the output of the following PHP code?
<?php
$a = 15;
$b = 20;
if ($a < ++$a || $b < ++$b){
echo "True";
}
else{
echo "False";
}
?>
- True
- False
- TrueFalse
- Parse Error
Answer: B) False
Explanation:
In PHP, the precedence of ++ operator is higher than < operator, so the first increment operation executes, and then the comparison operation will execute. But when the comparison operation executes, both OR operator conditions will return false. Thus, the else block will be executed.