Re: Use of 'self' in static function in subclass

From: Date: Wed, 02 Jun 2004 00:26:25 +0000
Subject: Re: Use of 'self' in static function in subclass
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-10236@lists.php.net to get a copy of this message
On Tue, 2004-06-01 at 19:53, Hans Lellelid wrote: > Yeah +1 on self:: binding at runtime. I can't really imagine a case > where you would want to refer to 'self' as the class that contains the > method *and not* the overridden method in invoked class (if it exists). > Binding this at runtime will introduce many new design possibilities > with static classes and will also make self:: consistent with $this-> > behavior for objects. +1, I agree completely. I think it is critical to have a way to be able to have a static method call another static method in the same class that respects inheritance. If a developer wanted a call to not respect inheritance the class's name can be used instead of self with the same results (increased code maintenance should the class name change notwithstanding). -- Adam Bregenzer adam@bregenzer.net http://adam.bregenzer.net/

« previous php.internals (#10236) next »