Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88839 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70122 invoked from network); 15 Oct 2015 20:08:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2015 20:08:39 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.215.54 mail-lf0-f54.google.com Received: from [209.85.215.54] ([209.85.215.54:35245] helo=mail-lf0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/BD-23021-7C700265 for ; Thu, 15 Oct 2015 16:08:39 -0400 Received: by lffy185 with SMTP id y185so46036521lff.2 for ; Thu, 15 Oct 2015 13:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WyZnR/m7lRvmyBNbIk48RNM71AJZ2yNT3541ByEXDJw=; b=Y4a+PU+lj+qoU29p45YlNwAewj7GBrpp3ztgpGDX6J3r1EeWDiZOvp58JvXZo/xy5T +1s5wyGjWmFvetcnUMtSNJ1WUHJZUcrhLYpgz0z1KCfY46fkokYSAf379VOtGuMnvipI JMD8/mTNsikJDlpLgbEfe78xe8T+vd0+HVQL1Ac1DD2ijNHwf7SqdfJM4Pi2mDoxn1fJ 6cWwwFBwOivqtDYURh0sp6JYF62/0lQzvF7GNe4UJqB0dn7zNC8sDySlByM4l9JV/i/p dXw0//gkfFRwyQ7O+2qExlTDdCuCIM6lyNQYSh1Ul6uP8tiAVCXZvskxlovyplG51JOs QUdw== MIME-Version: 1.0 X-Received: by 10.180.208.68 with SMTP id mc4mr637143wic.60.1444939715639; Thu, 15 Oct 2015 13:08:35 -0700 (PDT) Received: by 10.27.14.14 with HTTP; Thu, 15 Oct 2015 13:08:35 -0700 (PDT) In-Reply-To: References: <561F4EEB.8070605@telia.com> Date: Thu, 15 Oct 2015 22:08:35 +0200 Message-ID: To: Sara Golemon Cc: Ryan Pallas , =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , Sammy Kaye Powers , PHP Internals Content-Type: multipart/alternative; boundary=001a11c3811a79069e05222a3ede Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Revisit trailing commas in function arguments From: nikita.ppv@gmail.com (Nikita Popov) --001a11c3811a79069e05222a3ede Content-Type: text/plain; charset=UTF-8 On Thu, Oct 15, 2015 at 10:04 PM, Sara Golemon wrote: > On Thu, Oct 15, 2015 at 12:51 PM, Ryan Pallas > wrote: > > I do h ave one question I just thought of though... how does the > allowance > > of trailing comma work with the splat operator (...)? I'm assuming a > > function call/definition may only have one or the other, is that correct? > > > Excellent question. The patch on Sammy's RFC was written in Feb 2013, > before variadics, so it doesn't take them into account. > > I would say that it should be modified to disallow a trailing comma > following either a variadic declaration or a splat invocation, since > the grammar around these two things prohibits followups anyway. > We allow multiple splats in one call. Something like this (after trailing comma patch) should be just fine: foo( ...$args, ...$moreArgs, ...$evenMoreArgs, ); We don't allow multiple variadic parameters. However I also see little point in explicitly forbidding this one case. You'd be able to use the trailing comma in all cases ... apart from that one single instance. Nikita --001a11c3811a79069e05222a3ede--