FROM PHP Manual:
Warning
If you assign a reference to a variable declared global inside a
function, the reference will be visible only inside the function. You
can avoid this by using the $GLOBALS array.
...
Think about global $var; as a shortcut to $var =& $GLOBALS['var'];.
Thus assigning another reference to $var only changes the local
variable's reference.
<?php
$a=array();
$a[]='works';
function myfunc () {
global $a, $b ,$c;
$b= $a[0];
$c=&$a[0];
$GLOBALS['d'] = &$a[0];
}
myfunc();
echo ' $b '.$b."<br>"; //works
echo ', $c '.$c."<br>"; //fails
echo ', $d '.$d."<br>"; //works
?>
For more information see:
What References Are Not and Returning References