Re: [PHP] Get class name in static method

2006-03-21 Thread Rafael
Yeap, that's the method we're using in PHP4, but when we tried to change to PHP5 we found out that the behaviour of debug_backtrace() had changed, and it's (was?) not even documented (well done, don't you think) And we haven't found any issue with this solution (...in PHP4)

[PHP] Get class name in static method

2006-03-20 Thread Stut
Hi all, I'm wanting to define a static method on a base class that then instantiates and returns an object of the type the static method was called on. I've searched the docs and Googled but everything I find says it's not possible and I just wanna check to make sure before I admit defeat.

Re: [PHP] Get class name in static method

2006-03-20 Thread Jochem Maas
Stut wrote: Hi all, I'm wanting to define a static method on a base class that then instantiates and returns an object of the type the static method was called on. I've searched the docs and Googled but everything I find says it's not possible and I just wanna check to make sure before I

Re: [PHP] Get class name in static method

2006-03-20 Thread Stut
Jochem Maas wrote: Stut wrote: What do I put where the ???s are? I've tried __CLASS__ and get_class() but both give me the base class name. Short of passing the classname to the static function I'm at a loss as to how to do this. However, Bar::Create('Bar') is a bit too sucky for me to be

Re: [PHP] Get class name in static method

2006-03-20 Thread Grant Young
Not sure about PHP5, but for PHP4 I found this hack solution at: http://passivedigressive.com/archives/2005-02/php-static-class-name-solution/ There are probably all sorts of issues with this approach, but it solved the problem at the time... HTH. Grant -- PHP General Mailing List