Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93546 invoked from network); 17 Sep 2011 15:15:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2011 15:15:45 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.43 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.216.43 mail-qw0-f43.google.com Received: from [209.85.216.43] ([209.85.216.43:50832] helo=mail-qw0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/63-05466-F99B47E4 for ; Sat, 17 Sep 2011 11:15:44 -0400 Received: by qwm42 with SMTP id 42so6683033qwm.2 for ; Sat, 17 Sep 2011 08:15:40 -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=URRA8QQzI+POgW7cNo8mtz/prjKXa/OxWKR1j7cwn4E=; b=fBxQvVnUSknoGBfkiCSmBnkV2M4Orbr+amxzzfZrkREGK69jsvuMZPFNaYNsYbU8Cq DnsZrNmLzSh4h3R6b+pkvS0PSk9alTMnWoIH32MXDLCRUqkpMemCLxTYdCblIWFK9GqX oLQOhaaHXaiEZRNXXiJm7Z7dfCHpT7UgSKZjQ= Received: by 10.52.23.76 with SMTP id k12mr518525vdf.225.1316272540092; Sat, 17 Sep 2011 08:15:40 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.94.142 with HTTP; Sat, 17 Sep 2011 08:15:20 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Sep 2011 23:15:20 +0800 X-Google-Sender-Auth: 07jhKGx9uu1dxeWcjvxhVQyVhaw Message-ID: To: Ferenc Kovacs Cc: 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) Hi: this is really a big bc break...(fatal error) is there any reason for us to really change this? In Yaf, there are a lot of Abstract classes, the subclass only need declared there argument when they really need it. and I really not think this change is good one, the 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.. 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 functio= n __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 allowing >>> 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 not >>> 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 > > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/