Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19189 invoked from network); 17 Jun 2015 16:36:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2015 16:36:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:35086] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/70-12455-D02A1855 for ; Wed, 17 Jun 2015 12:36:30 -0400 Received: by labko7 with SMTP id ko7so37174796lab.2 for ; Wed, 17 Jun 2015 09:36:26 -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=40rR8/NSEYK9ztatifBpQjU1ZKlv0ZNid7oLN9YCeJU=; b=FokRYR8ubEX6/12GW/mhnnQOPGBoYw7igmygxaA7QBEp1d9gAeQ1q9BPlOAyf6Wm+G DjJdc55wnpHeNHsGh42gIUTOMX7Dq/UO0KKnIJPgbM028nhzOI/QM71IxHUmbCFxOkLp 9TCbMQr8j/VFHarYHZlwhJ7ndVpYBrw+byDCuwBUaF9+/pGO8lUWg4/Mp1bBi8KKtWJT PjKOxhMw+EAVvkuoZM8gZLD1mbHJ9v4RbFzyJsli8/K6aIksBkRPbDKsv/hbdsklUFyQ OEqzaqG6f5xXIQGYQ9Pr4LVUb0w+1vyKkn9/cWBZdgtuWdY+ix6By63DmwgC9MCUNjkk c10A== MIME-Version: 1.0 X-Received: by 10.112.161.40 with SMTP id xp8mr8721405lbb.71.1434558986800; Wed, 17 Jun 2015 09:36:26 -0700 (PDT) Received: by 10.152.43.105 with HTTP; Wed, 17 Jun 2015 09:36:26 -0700 (PDT) In-Reply-To: <68262FAD-587B-47FF-B388-3B8551FDCA22@cschneid.com> References: <68262FAD-587B-47FF-B388-3B8551FDCA22@cschneid.com> Date: Wed, 17 Jun 2015 18:36:26 +0200 Message-ID: To: Christian Schneider Cc: PHP Development Content-Type: multipart/alternative; boundary=001a11c25f52d158980518b94a02 Subject: Re: [PHP-DEV] Revisit trailing commas in function call parameters? From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c25f52d158980518b94a02 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 17, 2015 at 2:05 PM, Christian Schneider wrote: > Hi there, > now that syntax for variadic functions was added I quickly wanted to ask > whether allowing trailing commas for function calls could be reconsidered= . > > It is a very small change to the language allowing something like > my_variadic_function( > "foo", > "bar", > "qux", > ); > which makes adding/removing additional parameters a little easier: No > comma has to be added/removed from the last line. > > Previously this was considered unnecessary but maybe things changed enoug= h > to reconsider it? It doesn't involve any BC break and I attached the very > simple patch needed in the master branch. > > If people still consider it more harm- than useful then please don't flam= e > me and I'll shut up again :-) > > Cheers, > - Chris > > > diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y > index 9612324..f299f3e 100644 > --- a/Zend/zend_language_parser.y > +++ b/Zend/zend_language_parser.y > @@ -639,7 +639,7 @@ return_type: > > argument_list: > '(' ')' { $$ =3D zend_ast_create_list(0, ZEND_AST_ARG_LIS= T); > } > - | '(' non_empty_argument_list ')' { $$ =3D $2; } > + | '(' non_empty_argument_list possible_comma ')' { $$ =3D $= 2; } > ; > > non_empty_argument_list: > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > hi, just linking to the previous rfc: https://wiki.php.net/rfc/trailing-comma-function-args and discussion: http://www.serverphorums.com/read.php?7,655532 --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c25f52d158980518b94a02--