PHP - Functions
What will be the output of this PHP code?
$a = 10;
function test() {
global $a;
$a = 20;
}
test();
echo $a;
$a = 10;
function test() {
global $a;
$a = 20;
}
test();
echo $a;
test(), global $a; links to the global variable $a.$a = 20; changes the global $a value to 20.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions