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

Explanation: global keyword accesses global variable.

Explanation by: Roshan
global keyword accesses global variable.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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