Q. What will be the output?
Code:
$x = 10;
function test() {
global $x;
echo $x;
}
test();
β
Correct Answer: (A)
10
Explanation: global keyword accesses global variable.