Folks,
Is my following comment correct or mistaken ?
$GLOBALS[‘z’] = $GLOBALS[‘x’] + $GLOBALS[‘y’]; **//A new “Global Variable” ‘$z’ is created inside the function.
Context:
[code]
$x = 1; //’Global Variable’ as outside function. It now exists in “Super Global” Variable array as: $GLOBALS[‘x’].
$y = 2; //’Global Variable’ as outside function. It now exists in “Super Global” Variable array as: $GLOBALS[‘y’].
function addition()
{
$GLOBALS[‘z’] = $GLOBALS[‘x’] + $GLOBALS[‘y’]; //A new “Global Variable” ‘$z’ is created inside the function.
}
addition();
echo $z; //Since ‘$z’ is present within the $GLOBALS[index] array. It is accessible outside the function.