Hi, On Nov 25, 2007 11:45 PM, Jeff Moore <[EMAIL PROTECTED]> wrote:
> > Hi, > > May I suggest renaming get_called_class() to get_static_class() to > correspond with the use of the static:: keyword for late binding. It was already kind of discussed, and get_called_class makes more sense IMO. "static class" is not self-descriptive. The class returned is the class that was initially referenced for the call, as in the class "called" initially. > parent:: and get_parent_class() [no parameters] should also correspond > when used in a static method context. They do, parent::foo(); should be the same as $class = get_parent_class(); $class::foo(); Of course, we can't make parent:: reference the parent class of the called one, as it would break BC. As in: class A { } class B extends A { public static function test() { echo get_class(new parent), '-', get_parent_class(); } } class C extends B { } C::test(); // A-A and not B-B > > > My preference is that parent:: be late binding. I would also like to > see an early bound __parent__ constant along the lines of __class__. > > Best Regards, > > Jeff > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal