Re: Re: Get name of extending class with static method call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 that there is no clean way of retrieving the name of the calling class, in a classmethod defined in the superclass. I do not want to overload the sperclass' method.

I do not accept that this is misusing the static concept - without it, PHP 5 seems rather lame. How does one go about making a feature request? There has to be a way to get this implemented into PHP 5...

Cheers,



-Morten



Jochem Maas wrote:
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 thank all of those that cared about my problem and tried to
find a solution by providing a wide variety of ideas. Thank you very much!!!



Do you think it would be wise to ask for help on php-dev?




I'll put money on that they say "won't do it" and then tell you to read the archives of php-internals as to why.


I originally hit this problem when I started to write a PHP5 based framework at the end of 2003. during the time since then I have watched/read quite a few threads on this subject.


my solution used call_user_func_array(), its relatively slow and a ****ing nightmare in terms of complexity.


I strongly suggest you brew a big pot of coffee and sit down for a few (lots??) hours to read thru what has been discussed on php-internals, you might start with:


http://www.zend.com/lists/php-dev/200307/msg00242.html

basically, AFAIKR, the final answer was something along the lines of - 'your misusing the static class concept' (don't hold me to that tho!)



Perhaps the way to go about this would be to make a "feature request" on bugs.php.net? It does seem like something that should be a part of the language.






-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux