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

Explanation: Variable not available inside function without global or parameter.

Explanation by: Roshan
Variable not available inside function without global or parameter.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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