Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55484 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2732 invoked from network); 17 Sep 2011 15:54:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2011 15:54:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.45 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.45 mail-vw0-f45.google.com Received: from [209.85.212.45] ([209.85.212.45:48560] helo=mail-vw0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/45-05466-9B2C47E4 for ; Sat, 17 Sep 2011 11:54:34 -0400 Received: by vws17 with SMTP id 17so7905487vws.32 for ; Sat, 17 Sep 2011 08:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=k8Ff+lwfyyLDelSV5iLOTZPYUCp5jUpp8B1r++LrA9w=; b=goxM5V5aapQJqmcLzU9ke1Ia5nw50XB1P7cgSBOAD/pDjkae4e8/yum0qcTrdVXMrX 2HRRsOylUhc2jbfQGKV3uOnDZgcAvqnmMwxrUUiQIxd4fCbHauXLuseFiWKJEfRG+8Up 90uGLkPTRi5ZJdxhttwKqz8iiCgPX5gOt0AP4= Received: by 10.52.98.165 with SMTP id ej5mr550327vdb.158.1316274871133; Sat, 17 Sep 2011 08:54:31 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.94.142 with HTTP; Sat, 17 Sep 2011 08:54:11 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Sep 2011 23:54:11 +0800 X-Google-Sender-Auth: 4qsYxPXQszHnnwLvCQx-sC2-mPs Message-ID: To: Etienne Kneuss Cc: Ferenc Kovacs , Nikita Popov , RQuadling@gmail.com, PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] __constructor parameter limitations. From: laruence@php.net (Laruence) 2011/9/17 Etienne Kneuss : > > > On Sat, Sep 17, 2011 at 17:15, Laruence wrote: >> >> Hi: >> =C2=A0this is really a big bc break...(fatal error) >> =C2=A0is there any reason for us to really change this? =C2=A0 In Yaf, t= here >> are a lot of Abstract classes, =C2=A0the subclass only need declared the= re >> argument when they really need it. > > Well, that is wrong. if you declare an abstract method with a set of > arguments, classes implementing that method should be compatible with tha= t > set of arguments. > >> >> =C2=A0and I really not think this change is good one, =C2=A0the Intenal = class >> can not be saw by userland(sure, doc, reflection), so they only get >> the FATAL ERROR(you are wrong) but will never be told how should they >> to do.. > > Given that we have been quite flexible with this in the past, I don't > believe a E_FATAL is warranted here, might be better suited as a E_STRICT= , > as there is no apparent reason why this would prevent the engine to > continue. > Hmm, E_STRICT is better, I support. Thanks >> >> thanks >> >> 2011/9/17 Ferenc Kovacs : >> > maybe Richard referring to https://bugs.php.net/bug.php?id=3D55085 ? >> > but those change only affects the abstract classes. >> > >> > Tyrael >> > >> > On Sat, Sep 17, 2011 at 3:43 PM, Nikita Popov >> > wrote: >> >> Hi Richard! >> >> >> >> Which change are you talking about? I just tried doing: >> >> =C2=A0 =C2=A0> >> =C2=A0 =C2=A0class A =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 { public func= tion __construct($a) =C2=A0 =C2=A0 { } } >> >> =C2=A0 =C2=A0class B extends A { public function __construct($a, $b) = { } } >> >> And it worked on 5.4 Beta 1 without errors. >> >> >> >> Nikita >> >> >> >> On Sat, Sep 17, 2011 at 3:27 PM, Richard Quadling >> >> wrote: >> >>> Hi. >> >>> >> >>> With the recent BC with regard the locking of the constructor's >> >>> signature for subclasses, what is the expected mechanism for allowin= g >> >>> a subclass to have additional parameters? >> >>> >> >>> You can always supply them and use func_get_args() / func_num_args()= / >> >>> etc. to read them. >> >>> >> >>> It would seem that the limitation restricts the capabilities. I'm no= t >> >>> a purist. Software development is a compromise between purity and >> >>> getting the job done in an efficient and understandable manner. >> >>> >> >>> By allowing undocumented parameters to the constructor (due to the >> >>> enforced signature), this would seem to break things on a different >> >>> front (I can't docblock non defined parameters for examples). >> >> >> >> -- >> >> PHP Internals - PHP Runtime Development Mailing List >> >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> >> > >> > >> > >> > -- >> > Ferenc Kov=C3=A1cs >> > @Tyr43l - http://tyrael.hu >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> >> >> >> -- >> Laruence =C2=A0Xinchen Hui >> http://www.laruence.com/ >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > > -- > Etienne Kneuss > http://www.colder.ch > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/