note 92642 added to language.references.whatdo
| From: | gwideman at osu1 dot php dot net | Date: | Sat, 01 Aug 2009 23:38:31 +0000 |
| Subject: | note 92642 added to language.references.whatdo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158993@lists.php.net to get a copy of this message | ||
Could someone elaborate on what the heck this "Note" is talking about?
--------------------
"Note: Not using the & operator causes a copy of the object to be made. If you use $this in
the class it will operate on the current instance of the class. The assignment without & will
copy the instance (i.e. the object) and $this will operate on the copy, which is not always what is
desired. Usually you want to have a single instance to work with, due to performance and memory
consumption issues. "
--------------------
OK, "use $this in the class" -- is this referring to using $this in a static (ie: class)
method? If so, how is there an "instance of the class" to operate on?
Then "The assignment without & will copy the instance (i.e. the object) and $this will
operate on the copy". Huh? Now we're talking about a method of an object (not a class)
right? And under exactly what circumstance will "$this operate on a copy" (of the current
object?)?
Maybe this is an important note, but I for one can't decode what it's attempting to tell
at all.
----
Server IP: 208.69.120.35
Probable Submitter: 68.7.44.17
----
Manual Page -- http://www.php.net/manual/en/language.references.whatdo.php
Edit -- https://master.php.net/note/edit/92642
Del: integrated -- https://master.php.net/note/delete/92642/integrated
Del: useless -- https://master.php.net/note/delete/92642/useless
Del: bad code -- https://master.php.net/note/delete/92642/bad+code
Del: spam -- https://master.php.net/note/delete/92642/spam
Del: non-english -- https://master.php.net/note/delete/92642/non-english
Del: in docs -- https://master.php.net/note/delete/92642/in+docs
Del: other reasons-- https://master.php.net/note/delete/92642
Reject -- https://master.php.net/note/reject/92642
Search -- https://master.php.net/manage/user-notes.php