Q. What is the output of the following?
<?php
$a = 'Hello';
$b = &$a;
$b = 'World';
echo $a;
?>
Code:
<?php
$a = 'Hello';
$b = &$a;
$b = 'World';
echo $a;
?>
$a = 'Hello'; $b = &$a; $b = 'World'; echo $a;
β
Correct Answer: (A)
World
Explanation: Assigning by reference means both variables point to the same data.