Am 26.11.2007 um 19:13 schrieb Stanislav Malyshev:

- static always points to the original callee, w/o being "broken" by parent:: - get_called_class() should _not_ behave like shown above. It really was not B that got called, but it was A, trough parent::
- a new get_static_class() method should return "B".

Ouch. So now not only we have parent:: and Class:: behave differently (and I'm afraid to think of how call_user_func() should work) we also have two separate functions for getting called class and only one of them has non-functional notation. Yes, this is natural and intuitive. Not.

(essentially, get_called_class() returns the name of "self", while

You don't need a function to get "self". You have __CLASS__ for that.

Ah. Right. Didn't think of that. Well, then, get_called_class() should of course maintain the context (i.e. return the original callee) even with parent::


David

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to