Here's something that I can't manage to find explicitly documented. In the
following snippet:
function outer() {
global $a;
function inner() {
global $a;
echo $a.'1<br>';
}
$a = 's';
inner();
echo $a.'2<br>';
}
outer();
?>
If either of the globals statements is removed, the variable is not
accessable within inner.
following snippet:
function outer() {
global $a;
function inner() {
global $a;
echo $a.'1<br>';
}
$a = 's';
inner();
echo $a.'2<br>';
}
outer();
?>
If either of the globals statements is removed, the variable is not
accessable within inner.
Comment