What aren't References

As said above, references aren't pointers. That means, the following construct won't do what you expect:


function foo (&$var) {
    $var =& $GLOBALS["baz"];
}
foo($bar); 
     

What will happen that $var in foo will be bound with $bar in caller, but then it will be re-bound with $GLOBALS["baz"]. There's no way to bind $bar in the caller to something else using reference mechanism, since $bar is not available in the function foo (it is represented by $var, but $var has only variable contents and not name-to-value binding in the calling symbol table).