note 77406 added to language.oop.newref
| From: | mentepollophpero at osu1 dot php dot net | Date: | Tue, 28 Aug 2007 15:20:42 +0000 |
| Subject: | note 77406 added to language.oop.newref | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129856@lists.php.net to get a copy of this message | ||
Continuing aib's note (31-May-2006 11:20) on the new behavior of PHP 5.x:
Not only the "new" operator now returns a reference of the object (instead of a copy of
the object as in PHP4), but more importantlly: now the assignment operator when acting on objects
assigns by reference not by value.
This means operator =& is equal to operator = , but only when acting on objects. If you want to
copy (clone) an object use: $B = clone $A;
Java creators got it right from the begining :)
----
Server IP: 69.147.83.197
Probable Submitter: 88.1.201.196
----
Manual Page -- http://www.php.net/manual/en/language.oop.newref.php
Edit -- https://master.php.net/note/edit/77406
Del: integrated -- https://master.php.net/note/delete/77406/integrated
Del: useless -- https://master.php.net/note/delete/77406/useless
Del: bad code -- https://master.php.net/note/delete/77406/bad+code
Del: spam -- https://master.php.net/note/delete/77406/spam
Del: non-english -- https://master.php.net/note/delete/77406/non-english
Del: in docs -- https://master.php.net/note/delete/77406/in+docs
Del: other reasons-- https://master.php.net/note/delete/77406
Reject -- https://master.php.net/note/reject/77406
Search -- https://master.php.net/manage/user-notes.php