Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68918 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36513 invoked from network); 6 Sep 2013 17:55:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2013 17:55:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.51 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.219.51 mail-oa0-f51.google.com Received: from [209.85.219.51] ([209.85.219.51:48945] helo=mail-oa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/06-05619-E171A225 for ; Fri, 06 Sep 2013 13:55:43 -0400 Received: by mail-oa0-f51.google.com with SMTP id h1so4298916oag.10 for ; Fri, 06 Sep 2013 10:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QAHuFjYXRxUkJ33UsEuWFIczzxaMLzSxUYobaDOCweg=; b=At3wHkXh4F5nrEPUbTSnD3LtXorirICKKX6CfUWcKz0vPnehwWq9zIu9gvKg/okFn1 1IbcK1ujAGR2tmRRt3DtCWZuUWgaI3Y8fTNRKVAFHj/juRC42bESxRTZivzGBzKPe0mF e8uxJHn8Tb1cyq3Hw077H91YNLATIpI1MvHDNOZ/4t/FJXgC6aB/HjvbuMy7yICsP/63 MaEnf2F53q3ABRTP7mX8YEnYZH7hvgV+m0JFdN2IxGcPwdYreBy8O+orIrV4WJcsdiiu d4SCXBjmsoLTRHvZrHvfSfGT42co0Qt7XsQ5xD6Bm6apC8DTap/NwDmHL6y14cbmTK3k FEWw== X-Received: by 10.60.96.131 with SMTP id ds3mr2782961oeb.50.1378490139920; Fri, 06 Sep 2013 10:55:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.100.6 with HTTP; Fri, 6 Sep 2013 10:55:19 -0700 (PDT) In-Reply-To: References: Date: Fri, 6 Sep 2013 19:55:19 +0200 Message-ID: To: Adam Harvey Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=089e01227b7c1fe11a04e5babfc9 Subject: Re: [PHP-DEV] [RFC] Named parameters From: linepogl@gmail.com (Lazare Inepologlou) --089e01227b7c1fe11a04e5babfc9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2013/9/6 Adam Harvey > > > Variadics/splat: collecting both named and positional arguments into > one array seems reasonable to me. I think the main use case there > would be option parameters, which you'd have to validate anyway, so > positional parameters would be dealt with at that point =E2=80=94 I don't= see > separate arrays as conferring any great advantage in terms of > validating parameters, and it's no simpler conceptually. > > There is a small drawback. Suppose this code: function foo( $bar =3D 0 , ...$args ){} foo( bart =3D> 3 ); // misspelled name According to the RFC, any unknown argument name will fall into the $args array, making the above code valid. As this cannot be verified statically, it is a possible source of bugs. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel --089e01227b7c1fe11a04e5babfc9--