Q. What will be the output?

Code:
$a = [];
$a[] = &$a;
echo count($a);
  • (A) 1
  • (B) 2
  • (C) Error
  • (D) Infinite loop
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1
Explanation: Self-referencing array still has one element.
Explanation by: Roshan
Self-referencing array still has one element.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
40
Total Visits
πŸ“½οΈ
6 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
96%
Success Rate