Re: Re: bug of the day: $this
| From: | Stig S. Bakken | Date: | Fri, 06 Dec 2002 21:12:33 +0000 |
| Subject: | Re: Re: bug of the day: $this | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-92176@lists.php.net to get a copy of this message | ||
On Wed, 2002-12-04 at 01:32, Balazs Nagy wrote:
> On Tue, 2002-12-03 at 21:53, Ivan Ristic wrote:
> > Balazs Nagy wrote:
> > > Hi,
> > >
> > > $this stays defined when an instantatiated member function calls a
> > > non-instantiated member function.
> >
> > Correct. I actually find it quite interesting. :)
> > It can be useful at times, I have used it in my
> > libraries as a feature.
> >
> > There is an interesting article on the subject:
> > http://www.advogato.org/article/470.html
>
> Now, please tell me how can you decide whether the member function is
> called as an object element (eg. $obj->func()) or as a class element
> (eg. class::func()).
>
> Basic functionality is killed with this so-called feature. The right
> way should be a call stack, with for example a $_STACK array, or through
> stack functions (eg. this_object(), previous_object()).
this_object()? LPC? :)
- Stig