?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = 10; $b = 10;
if ($a = 5)
$b--;
print $a;print $b--;
?>
<?php
$a = 10; $b = 10;
if ($a = 5)
$b--;
print $a;print $b--;
?>
Answer & Solution
Correct Answer:
Option
B
a is set to 5 in the if condition and b is postdecremented in the print statement.
Join the Discussion
Login to post a comment or share your explanation.
Login