My question is actually regarding the line "$myref = &$this;". The author states that this is a reference to the class/object itself. Isn't this like saying outside the class "$myref =& new test;"? What would be the point of referring to itself inside the class in this manner? Thanks for your help in advance!


-Adam Reiswig

The exact class that the author wrote isn't too useful, although it makes its point well. However, a reference to $this inside a class can be useful, for example, if you were using the observer pattern.
http://www.phppatterns.com/index.php/article/articleview/27/1/1/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to