Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33434 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39218 invoked by uid 1010); 26 Nov 2007 09:24:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39203 invoked from network); 26 Nov 2007 09:24:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2007 09:24:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.170.189 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 64.233.170.189 rn-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.170.189] ([64.233.170.189:49624] helo=rn-out-0102.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/21-28547-5B09A474 for ; Mon, 26 Nov 2007 04:24:06 -0500 Received: by rn-out-0102.google.com with SMTP id s28so95351rnb for ; Mon, 26 Nov 2007 01:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=j0tAozE+yB4j1Y6nFPqO8SJRjIl/W7HkPc0ESbYlJrE=; b=HsMQ9xNaIiCkNekNEQJmJqtXiBDYL4iwJkgXlinVPe7WnW2Bwt59s72GRFPEau9veIqtss6fJfLZM56tLQ/xBRgs/00qTv2TZM894xgXh2IaJOS+dCcglHW/y97CzRO4WOhnsQa25cQhGzaxVE2/Np3j4prz7dFbnV/196Zfc2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i1or4dLfZpxZzKXsLd0RttZtw5Ev1XH+jhRu+iu58g/PIee2gNIPr+q+KUluSaYPCl7ta5PM+B1Mb/T5iOTR/EFRGRNCKjlOHob3FjPfAzA0YLA661+ZiZR7ja28+7UhxniowXzrsHgVdtTxvcC+rYvtvqNqEydhWgDqiygqxj8= Received: by 10.150.211.19 with SMTP id j19mr270793ybg.1196069043046; Mon, 26 Nov 2007 01:24:03 -0800 (PST) Received: by 10.150.57.12 with HTTP; Mon, 26 Nov 2007 01:24:03 -0800 (PST) Message-ID: Date: Mon, 26 Nov 2007 12:24:03 +0300 To: "Mike Lively" Cc: "PHP Developers Mailing List" In-Reply-To: <4749F328.8080506@digitalsandwich.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4740C654.3020302@digitalsandwich.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> <4743CED7.5050402@avalon.aut.bme.hu> <4749F328.8080506@digitalsandwich.com> Subject: Re: [PHP-DEV] [PATCH] late binding for parent (and other options) - Was Re: [PHP-DEV] late static binding php6 From: indeyets@gmail.com ("Alexey Zakhlestin") On 11/26/07, Mike Lively wrote: > I have come up with three different patches that allow us to work around > the issue of parent:: being considered an 'explicit class reference' and > thus disallowing static:: to effectively used. > > The patches are against 5.3. I also have patches against HEAD but I was > having problems getting run-tests.php to run against that code base (it > would hang on the first test no matter which set of tests I ws running.) > > All three patches have different levels of intrusiveness to the engine > and all three patches have been tested against (and pass) the existing > lsb tests in Zend/tests/lsb_*.phpt > > 1.) lsb.parent-forwarding.patch > This patch modifies the behavior of only parent:: to not change > EG(called_class) to the parent of the current scope. With this change. > > > class A { > public static function test() { > echo get_called_class()."\n"; > } > } > > class B extends A { > public static function test() { > parent::test(); > } > } > > A::test(); > B::test(); > > ?> > will output: > A > B > > It should be noticed that with this patch parent:: will always resolve > to the parent of the current scope, it will just not make any changes to > the called_scope (effectively) I believe this first patch is the proper way to go. It feels "natural", "intuitive", etc. -- Alexey Zakhlestin http://blog.milkfarmsoft.com/