Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59623 invoked from network); 23 Sep 2011 08:23:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2011 08:23:29 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:49065] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/81-46707-0024C7E4 for ; Fri, 23 Sep 2011 04:23:28 -0400 Received: by gwj16 with SMTP id 16so2376935gwj.29 for ; Fri, 23 Sep 2011 01:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=gqTXSg/lNbQqZpCKQIthCdRUdAMXU6i9uB+iy9B7jeY=; b=fEj0t5KbOOau9deIE/qxey7063s4sBoOnczxByuKb2ZFogqmzQHO1RLkUCJ1WbFQ97 ZdEqRv3Hq/JFXDqCkBMEX1uS3QSKupdbTAQrlP1Fi8ipjY8R4loqh9qzLUQqn+FbaBw1 hiHXotloqU3giJqPLekjZsdhg0G69F9WcG61U= MIME-Version: 1.0 Received: by 10.146.181.25 with SMTP id d25mr3049896yaf.3.1316766205685; Fri, 23 Sep 2011 01:23:25 -0700 (PDT) Received: by 10.147.125.13 with HTTP; Fri, 23 Sep 2011 01:23:25 -0700 (PDT) In-Reply-To: <4E78EB10.6040607@sugarcrm.com> References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> <4E7708FA.7080802@sugarcrm.com> <4E78D01C.6040909@sugarcrm.com> <4E78E46A.5030404@thelounge.net> <4E78EB10.6040607@sugarcrm.com> Date: Fri, 23 Sep 2011 10:23:25 +0200 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] __constructor parameter limitations. From: tyra3l@gmail.com (Ferenc Kovacs) On Tue, Sep 20, 2011 at 9:35 PM, Stas Malyshev wro= te: > Hi! > > On 9/20/11 12:07 PM, Reindl Harald wrote: >> >> but it is not logical >> >> foo() in B can do anything with $a before or after parent::foo() >> and the caller does not need to know at any point that B >> has anything to do with the class A > > Consider this code: > > function doFoo(A $a) { > =C2=A0$a->foo(); > } > > It's fine, right? Since A::foo() signature fits. > Now consider this code: > > $a =3D new B(); // B extends A, it's OK, right? > doFoo($a); // oops, $a->foo() breaks! > > This code would break since B::foo() requires a parameter. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > A little bit off-topic, but maybe we could also discuss/fix this: https://bugs.php.net/bug.php?id=3D43200 http://groups.google.com/group/symfony-devs/browse_thread/thread/3fc16ba601= 045551 --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu