Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28250 invoked by uid 1010); 1 Jun 2004 23:53:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28123 invoked from network); 1 Jun 2004 23:53:55 -0000 Received: from unknown (HELO lakermmtao03.cox.net) (68.230.240.36) by pb1.pair.com with SMTP; 1 Jun 2004 23:53:55 -0000 Received: from [192.168.3.100] (really [68.98.128.109]) by lakermmtao03.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040601235353.VFWR21849.lakermmtao03.cox.net@[192.168.3.100]>; Tue, 1 Jun 2004 19:53:53 -0400 Message-ID: <40BD1706.1010202@velum.net> Date: Tue, 01 Jun 2004 19:53:42 -0400 User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ferdinand Beyer CC: Timm Friebe , internals@lists.php.net References: <20040601131122.36657.qmail@pb1.pair.com> <40BCF985.26931.1418D27@localhost> In-Reply-To: <40BCF985.26931.1418D27@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Use of 'self' in static function in subclass From: hans@velum.net (Hans Lellelid) Ferdinand Beyer wrote: > On 1 Jun 2004 at 21:13, Timm Friebe wrote: > > >>Yes: self is bound at compiletime. It would need to be changed to >>evaluation at runtime und would be far more useful then. >> >>[...] >> >>I wouldn't mind chaning self in the first place, though. > > > I prefer your solution to evaluate self at runtime instead of adding a > new keyword 'this'. The second one would only be confused with > $this. Many people (including me) are already familiar with 'self' and > expect it to refer to the class from within it is called. > 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. Hans