Re: Get name of extending class with static method call
| From: | Torsten Roehr | Date: | Tue, 11 Jan 2005 18:38:52 +0000 |
| Subject: | Re: Get name of extending class with static method call | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206093@lists.php.net to get a copy of this message | ||
"Jason Barnett" <jason.barnett@telesuite.com> wrote in message
news:20050111164037.7759.qmail@pb1.pair.com...
> M. Sokolewicz wrote:
> > try using __CLASS__
> >
> > Torsten Roehr wrote:
> >
>
> This is a good suggestion but I wonder... Torsten do you have a large
> heirarchy of parent classes or just one parent? E.g. Car -> Sports Car
> -> Porsche. More importantly will __CLASS__ resolve to the class name
> that you need...
>
> If __CLASS__ works for you then I would go with it. If not can you just
> send the appropriate class name as a parameter?
__CLASS__ contains the name of the class the method is in. In my sample it
would be 'Car' and not 'Porsche'.
What I don't understand is why the behaviour of debug_backtrace() has been
changed!?!
Regards, Torsten