|
Posted by David Haynes on 04/11/06 20:36
Areric wrote:
> SO what is the point of the &. I tried that option as well and was told
> on another site i should use & to make a reference to the class?
>
Think of '&' as 'address of'.
So $bar = & new Bar();
is '$bar equals the address of the instance of the class Bar'
To use it, you would have to dereference it twice (once to resolve the
reference and once to resolve the instance).
So if Bar had a method foo(), you would access it as:
$$bar->foo();
As Justin points out, if you really want to use reference to instances
and not just instances, then there is loads of support in PHP5.
-david-
Navigation:
[Reply to this message]
|