|
Posted by ZeldorBlat on 09/27/07 16:30
On Sep 27, 12:12 pm, Summercool <Summercooln...@gmail.com> wrote:
>
> i think pointer and reference are the same thing, like in Java and
> Ruby.
> In PHP, what the manual calls "reference" is actually not a reference
> in other languages... it is like an alias or (a nickname).
Correct -- it is a "symbol table alias."
>From the manual:
"References in PHP are a means to access the same variable content by
different names. They are not like C pointers; instead, they are
symbol table aliases. Note that in PHP, variable name and variable
content are different, so the same content can have different names."
Personally I think that's much simpler than the reference model in
other languages.
Also be aware of the distinction between "passing by reference" (as
in, passing to a function) and assigning references.
[Back to original message]
|