πŸ“Š PHP
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

πŸ‘οΈ
51
Total Visits
πŸ“½οΈ
6 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
84%
Success Rate