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

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