Magic Of PHP
June 23rd, 2005
4 comments
When I started to customize SugarCRM I needed to study PHP againg. Because my last PHP project was four years ago. So, I found some strange notation of creation of PHP objects:
$obj = & new SomeObjest();
I asked guys who work with me and have experience with PHP about sign “&“. But unfortunatelly, nobody could to explain me meaning of that construction. Recently, I found explanation. PHP4 creates an object and assign it to some variable by value. Using “&” we can assign the object by reference. In other words, we get a reference to the object instead of object itself.
In PHP5 it’s done automatically. In Perl too ![]()
Categories: Digital Life




