I have been reading the PHP manual about references and something is confusing me. It says that references are not pointers to memory addresses but rather…
Instead, they are symbol table
aliases.
Isn’t this essentially a pointer if the reference points to the symbol table entry which then points to a memory address?
Edit:
Some great answers. Just want to pop this in here… How would I unset the variable for which another is pointing to?
$var = "text";
$ref =& $var;
unset($ref);
It looks like for this to work, I need to unset $var as well so the GC removes it.
There is a wonderful PHP References Tutorial which should explain everything in a more in depth manner than the PHP docs themselves (gasp), even going so far as to explain what happens upon variable creation.