A

Admin • 833K Points
Coach

Q. What will be the output of the following PHP code ?

Code:
<?php
$t = 5;
if ($t-- == ++$t)
{
echo $t;
}
?>
  • (A) Error
  • (B) 0
  • (C) Nothing
  • (D) 5
  • Correct Answer - Option(D)
  • Views: 21
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

First $t = 5 is compared to and then decremented, then incremented and compared to $t = 5.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.