Hi,

On Wed, Nov 23, 2011 at 4:09 AM, mmhan <[email protected]> wrote:

> I was just curiously checking out some of the core code in github and
> stumbled upon this.. I'm just wondering the reasoning behind it.In PHP4...

Yes, in PHP4...

$obj2 = $obj;

... would assign a copy of $obj to $obj2. i.e. an entirely different
object which is a copy of $obj.

So in PHP4, &= is need to assign a reference to $obj to $obj2.

In PHP5...

$obj2 = $obj;

... assigns $obj2 as a reference of $obj by default so &= is not required.

Cheers,

Andy

-- 
Andy Gale
http://andy-gale.com
http://twitter.com/andygale

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to