Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49974 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39190 invoked from network); 26 Oct 2010 15:46:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2010 15:46:50 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:51642] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/52-26081-9E7F6CC4 for ; Tue, 26 Oct 2010 11:46:50 -0400 Received: by qyk32 with SMTP id 32so2529517qyk.8 for ; Tue, 26 Oct 2010 08:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=bBNZtuEsP38c6EzePNiqLLDGmEmVgresIKj0ts2tX0g=; b=cSQLtYScG4AiCyxJ8uPj12iwy0kibgLcch1F+pVc1+JRoAgeWlErEnat8rXvd382fe Ws/8VQxPHurzMKs5n0VXzoJDOXM8HgRz/TVUioW2dY4eswg5XzdJqck6xCxUr6bgQZJp aFPzNawHwtGO/DpJjBt5+J6Wc3QCdI5X4W0ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=AzKmz6s4jnGthAIAQK8eH1Y+9Mv2DB7ONzvHjyv+Kf9QlP9MeAVM9g54UjOdTIYNUh kz0OOxlWQYYZ6y+b6p4elDrG8Re5ufiJZskbLLOWW/XKV5Lr/6qJVAbxuv7BtOt+z5va 0Ev4xTpIW2bA3+cIZVzPpzoR+rFc8BWXSKn28= Received: by 10.224.207.71 with SMTP id fx7mr1574721qab.309.1288108007326; Tue, 26 Oct 2010 08:46:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.21.201 with HTTP; Tue, 26 Oct 2010 08:46:23 -0700 (PDT) Reply-To: RQuadling@googlemail.com In-Reply-To: <20101026144822.GA8987@panix.com> References: <20101024223825.GC19835@gerbil.thgnet.it> <4CC4B628.3060304@sugarcrm.com> <20101024225628.GB88594@croustillant.local> <20101026144822.GA8987@panix.com> Date: Tue, 26 Oct 2010 16:46:23 +0100 Message-ID: To: Daniel Convissor Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic From: rquadling@gmail.com (Richard Quadling) On 26 October 2010 15:48, Daniel Convissor wrote: > On Mon, Oct 25, 2010 at 12:56:28AM +0200, Etienne Kneuss wrote: > >> Exactly, if Bar::getFoo is not called statically, parent::getFoo() will >> not be a static call, it should not get through __callStatic. > > That logic sounds good. =C2=A0Unfortunately, things aren't behaving that = way: > > > // Rework of code from http://bugs.php.net/bug.php?id=3D51176 > class p { > =C2=A0 =C2=A0 =C2=A0 =C2=A0public function __call($n, $a) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "call\n"; > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > =C2=A0 =C2=A0 =C2=A0 =C2=A0public static function __callStatic($n, $a) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "callStatic\n= "; > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > } > > class c extends p { > =C2=A0 =C2=A0 =C2=A0 =C2=A0public function existing() { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parent::non_existi= ng(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > } > > $c =3D new c; > echo 'static =3D '; > c::s(); > echo 'object =3D '; > $c->o(); > echo 'parent =3D '; > $c->existing(); > > echo phpversion() . "\n"; > > > Thanks, > > --Dan So the calling context/scope is going to have to be used to determine if the call should get to __call or __callStatic. Is that possible? Appropriate? Easy to do? Done by Friday? --=20 Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY