Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Jochem Maas wrote: Mehdi Achour wrote: Because it's a change, that should be reverted, or documented. don't top post - its bad form and many people ignore topposts. Mehdi is right to say that debug_backtrace() has changed - but so has the whole engine - I don't think that function was ever meant

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Jochem Maas wrote: Morten Rønseth wrote: Hi, I just tried the example code at http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 The backtrace doesn't see class b at all, all references to it have vanished into thin air. as a side note - using a function like debug_backtrace

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Mehdi Achour wrote: Because it's a change, that should be reverted, or documented. don't top post - its bad form and many people ignore topposts. Mehdi is right to say that debug_backtrace() has changed - but so has the whole engine - I don't think that function was ever meant to be used in the w

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Morten Rønseth wrote: Hi, I just tried the example code at http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 The backtrace doesn't see class b at all, all references to it have vanished into thin air. as a side note - using a function like debug_backtrace() seems to be a mi

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Mehdi Achour
Because it's a change, that should be reverted, or documented. didou M. Sokolewicz wrote: Torsten Roehr wrote: "Morten Rønseth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I just tried the example code at http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 The

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread M. Sokolewicz
Torsten Roehr wrote: "Morten Rønseth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I just tried the example code at http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 The backtrace doesn't see class b at all, all references to it have vanished into thin air. I

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
"Morten Rønseth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I just tried the example code at > http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 > > The backtrace doesn't see class b at all, all references to it have > vanished into thin air. > > I sp

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Hi, I just tried the example code at http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3 The backtrace doesn't see class b at all, all references to it have vanished into thin air. I spent days trying to solve this on my own until I happened upon this thread - it appears tha

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
darn, send button again!! (sent too early) Jochem Maas wrote: Jason Barnett wrote: Indeed! I was actually quite surprised that this wasn't the way __CLASS__ resolved... I had to code it to believe it (and I didn't even do that until after you told us __CLASS__ didn't work!) I would like to tha

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Jason Barnett wrote: Indeed! I was actually quite surprised that this wasn't the way __CLASS__ resolved... I had to code it to believe it (and I didn't even do that until after you told us __CLASS__ didn't work!) I would like to thank all of those that cared about my problem and tried to find

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jason Barnett
By "tunnelling" the call through Porsche's own drive() method debug_backtrace() will contain two traces, one of them with the correct class name. I tried using reflection but "reflecting" car by using __CLASS__ doesn't give any information about the classes that extend it. So this doesn't work eith

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
> Torsten, I also found the following link to be helpful. Check out the > user notes from michael at digitalgnosis dot removethis dot com (he did > something similar to what I have already suggested, i.e. call_user_func) > > http://www.php.net/manual/en/language.oop5.static.php Hi Jason, thanks

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Rory Browne
I was kinda thinking about all that too, for a project I'm currently doing, in that I wanted to be able to create a singleton, without having to put the singleton code in each class. The only hack I could think of was to use debug_backtrace() to get the line of source that contained the call, and

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread M. Sokolewicz
Daniel Schierbeck wrote: Christopher Fulton wrote: This should work for you then(maybe...i don't have php5 on my system, so it may not, but i think it would. http://us4.php.net/manual/en/function.get-class.php class Car { function drive() { return get_class($this);

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Jason Barnett
Christopher Fulton wrote: This should work for you then(maybe...i don't have php5 on my system, so it may not, but i think it would. http://us4.php.net/manual/en/function.get-class.php class Car { function drive() { return get_class($this); } } class Porshe { } $

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Daniel Schierbeck
Christopher Fulton wrote: This should work for you then(maybe...i don't have php5 on my system, so it may not, but i think it would. http://us4.php.net/manual/en/function.get-class.php class Car { function drive() { return get_class($this); } } class Porshe { } $

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Christopher Fulton
This should work for you then(maybe...i don't have php5 on my system, so it may not, but i think it would. http://us4.php.net/manual/en/function.get-class.php class Car { function drive() { return get_class($this); } } class Porshe { } $foo = new Porshe(); ech