πŸ“Š PHP
Q. What will be the output?
Code:
function test(&$x) { $x = $x * 2; }
$a = 5;
test($a);
echo $a;
  • (A) 5
  • (B) 10
  • (C) Error
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (B) 10

Explanation: Pass by reference modifies original variable.

Explanation by: Roshan
Pass by reference modifies original variable.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
1
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
91%
Success Rate