Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33353 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49610 invoked by uid 1010); 20 Nov 2007 03:21:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49595 invoked from network); 20 Nov 2007 03:21:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2007 03:21:48 -0000 Authentication-Results: pb1.pair.com header.from=m@digitalsandwich.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=m@digitalsandwich.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain digitalsandwich.com does not designate 68.230.241.45 as permitted sender) X-PHP-List-Original-Sender: m@digitalsandwich.com X-Host-Fingerprint: 68.230.241.45 fed1rmmtao101.cox.net Solaris 10 (beta) Received: from [68.230.241.45] ([68.230.241.45:56081] helo=fed1rmmtao101.cox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/E0-50425-BC252474 for ; Mon, 19 Nov 2007 22:21:47 -0500 Received: from fed1rmimpo01.cox.net ([70.169.32.71]) by fed1rmmtao101.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20071120032144.OSUS26783.fed1rmmtao101.cox.net@fed1rmimpo01.cox.net>; Mon, 19 Nov 2007 22:21:44 -0500 Received: from [192.168.0.100] ([68.96.248.22]) by fed1rmimpo01.cox.net with bizsmtp id ErMk1Y0030Vk8yk0000000; Mon, 19 Nov 2007 22:21:44 -0500 Message-ID: <4741E23D.6030901@digitalsandwich.com> Date: Mon, 19 Nov 2007 19:21:33 +0000 User-Agent: Thunderbird 2.0.0.6 (X11/20071108) MIME-Version: 1.0 To: Stanislav Malyshev CC: PHP Developers Mailing List References: <4740C654.3020302@digitalsandwich.com> <474154E0.4070302@zend.com> <47417C65.8010708@iamjochem.com> <474130B3.9070303@digitalsandwich.com> <4741DC81.6000506@zend.com> <4741D574.2020800@digitalsandwich.com> <474247A2.5050301@zend.com> <4741D9D1.6030106@digitalsandwich.com> <47424B4F.2@zend.com> In-Reply-To: <47424B4F.2@zend.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] late static binding php6 From: m@digitalsandwich.com (Mike Lively) Stanislav Malyshev wrote: >> parent::test(); > > What do you want parent::test() to mean? > >> This will echo 'A'. So like I said you have no way here of telling that >> B:: was used. > > Because it wasn't. parent::test() means A::test(). 'parent::' means > 'parent class of the class where this statement is' in PHP. For B, > it's A. Yes but B::test() was called to start the call chain and in this situation I want the B::test() method to decorate A::test() and it just isn't possible without allowing parent:: to forward the called class or introducing a new keyword. > >> Then there are two problems (sort of). First problem being, then why >> bother with lsb, you can do this already (which more so a 'wth' as > > If you can do it - do it. I (and many other people) don't feel the need to do things this way and it is slightly frustrating to see a patch implemented to allow us to 'sort of' do it cleanly but ultimately misses the mark. Especially when it is probably a relatively minor change to support what we are asking for. This is also a terrible argument to use against a new feature...but that's an entirely separate matter. > >> opposed to a problem.) The second and much more prevelent problem is >> that iirc you cannot do this kind of loose inheritance with statics in > > What is 'loose inheritance'? By loose inheritance I mean extending and overwriting a method while changing that method's parameter list. I apologize, I grabbed php6 and appear to have not remembered things quite right. I thought that you could not change the parameter list of inherited static methods which is not the case in php6. Although you WILL have a problem if you program to interfaces. If static public test() is declared in an interface that A implements then you won't be able to change the parameter list in B.