[PHP] Re: $this variable reference question

2004-04-02 Thread Jason Barnett
It's not the same thing. When an variable references an object then you can change either the original object or the new variable and you will be changing the *same* object, not a new one. Maybe this example helps? ?php class test { function test($val) { global

[PHP] Re: $this variable reference question

2004-04-02 Thread Jason Barnett
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

Re: [PHP] Re: $this variable reference question

2004-04-02 Thread Adam Reiswig
Jason, thanks. Yes, I understand your example here very well. My question actually had more to do with understanding what value was added to the class by $myref = $this;. Perhaps it is some misunderstanding I have of classes but, since a class is just a pattern and not an actual, usable