Posted by Michael Fesser on 09/24/07 20:26
..oO(Joe)
>I am just starting to use Object Oriented PHP coding, and I am seeing
>quite often the following (this example taken from a wiki):
>
>$wakka =& new Wakka($wakkaConfig);
It was required in PHP 4 to make sure that $wakka will be assigned a
reference to the created object instead of just a copy of it, which
could lead to problems in some situations.
If you just start with OOP in PHP, then you should do this with PHP 5,
where objects are always passed as references by default and you don't
have to worry about this issue anymore (at least not for objects).
Micha
[Back to original message]
|