Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55523 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33909 invoked from network); 19 Sep 2011 09:12:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 09:12:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:57008] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/87-14600-197077E4 for ; Mon, 19 Sep 2011 05:12:52 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 5D0DE7000398 for ; Mon, 19 Sep 2011 10:12:45 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id OfxGXHUC4KyZ for ; Mon, 19 Sep 2011 10:12:45 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 1E81F70003A1 for ; Mon, 19 Sep 2011 10:12:44 +0100 (WEST) Received: from clk-0081.mshome.net (unknown [85.139.253.17]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id CC9312016F64 for ; Mon, 19 Sep 2011 10:12:44 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "internals@lists.php.net" References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> Date: Mon, 19 Sep 2011 10:12:44 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.51 (Win32) Subject: Re: [PHP-DEV] __constructor parameter limitations. From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") Em Mon, 19 Sep 2011 10:01:32 +0100, Etienne Kneuss escreveu: > Sure, but you mix two things here, references would have to be handled > specifically, and we would not allow to specify less args by ref. > > There is simply no reason for disallowing this with nornal args though. > Imagine the following code: > > interface Foo { public function plop ($a,$b,$c,$d) } > > class A implements Foo { > public function plop() { > $args = func_get_args(); > // ... > } > } > > This is perfectly valid PHP code, there is no valid usage of Foo that > will not work with A... So to me this restriction seems really arbitrary. > And I don;t believe missing an argument in the declaration of a method, > using it in the body of the method and not realising it is so much of a > common error that it would warrant this. > Arbitrary as it may be, it's nevertheless reasonably arbitrated given how little useful it is to just ignore arguments and how likely it is to a mistake. And I don't buy the func_get_args() argument. Why would anyone use func_get_args for anything other than variadic functions?... I certainly don't. -- Gustavo Lopes