Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33315 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91313 invoked by uid 1010); 19 Nov 2007 15:10:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91281 invoked from network); 19 Nov 2007 15:10:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2007 15:10:22 -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.42 as permitted sender) X-PHP-List-Original-Sender: m@digitalsandwich.com X-Host-Fingerprint: 68.230.241.42 fed1rmmtao104.cox.net Solaris 10 (beta) Received: from [68.230.241.42] ([68.230.241.42:35595] helo=fed1rmmtao104.cox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/71-05823-041A1474 for ; Mon, 19 Nov 2007 09:44:19 -0500 Received: from fed1rmimpo03.cox.net ([70.169.32.75]) by fed1rmmtao104.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20071119144415.MDYP14792.fed1rmmtao104.cox.net@fed1rmimpo03.cox.net>; Mon, 19 Nov 2007 09:44:15 -0500 Received: from [192.168.0.102] ([68.96.248.22]) by fed1rmimpo03.cox.net with bizsmtp id EekD1Y00G0Vk8yk0000000; Mon, 19 Nov 2007 09:44:13 -0500 Message-ID: <474130B3.9070303@digitalsandwich.com> Date: Mon, 19 Nov 2007 06:44:03 +0000 User-Agent: Thunderbird 2.0.0.6 (X11/20071108) MIME-Version: 1.0 To: Jochem Maas CC: Stanislav Malyshev , internals@lists.php.net References: <4740C654.3020302@digitalsandwich.com> <474154E0.4070302@zend.com> <47417C65.8010708@iamjochem.com> In-Reply-To: <47417C65.8010708@iamjochem.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) Jochem Maas wrote: > Stanislav Malyshev wrote: > >>> Rest assured that this is not the bad kind of 'more complex' I believe >>> >> I'm afraid I must disagree. The feature that was missing was to know the >> true calling class name. That was implemented. You can build from it, >> there's no need to add further complication to the language. You can >> easily find out the calling class for static call, you can easily find >> it's parent, provided one exists, you can easily call any method of this >> class. >> > > class A { > static function find($id) { > // lets try and find a 'something' > } > } > > class B extends A {} > > // I'd like a 'B' please bob. > $b = B::find( 1 ); > > > > are you saying that A::find() can tell that it was called as B::find() ? > No, your example would work. WHere it breaks down is if you want to specialize B::find(); class B extends A { static function find($id) { /* do something special */ parent::find($id); } } in that situation A::find(); would not be able to know it was being called by B::find() because parent:: is considered an explicit class name reference.