However, by instantiating a class with an ampersand in front of it, you could create a reference to the returned object, and it would behave like an object in other languages. This was a common technique prior to PHP5 to achieve OOP like effects and/or improve performance.
eg
$foo = 'bar'; $baz = &$foo; echo $foo //bar echo $baz //bar $foo = 'foobazbar'; echo $foo //foobazbar echo $baz //foobazbar
ref
http://www.php.net/manual/en/language.references.whatdo.php
http://us3.php.net/manual/en/language.references.pass.php
0 comments:
Post a Comment