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
πŸ’¬ Discuss
βœ… Correct Answer: (A) World
Explanation: Assigning by reference means both variables point to the same data.
Explanation by: Rati Dubey
Assigning by reference means both variables point to the same data.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
108
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
81%
Success Rate