A

Admin • 833K Points
Coach

Q. What is the output of the following?
<?php
$a = 'Hello';
$b = &$a;
$b = 'World';
echo $a;
?>

Code:
$a = 'Hello';
$b = &$a;
$b = 'World';
echo $a;
  • (A) World
  • (B) Hello
  • (C) Error
  • (D) Nothing
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

Assigning by reference means both variables point to the same data.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.