Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97289 invoked from network); 17 Jun 2015 12:05:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2015 12:05:42 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Received: from [195.226.6.51] ([195.226.6.51:60936] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/E0-23581-59261855 for ; Wed, 17 Jun 2015 08:05:41 -0400 Received: from [10.1.0.224] (unknown [62.12.168.162]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 1AED9C07FF for ; Wed, 17 Jun 2015 14:05:00 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <68262FAD-587B-47FF-B388-3B8551FDCA22@cschneid.com> Date: Wed, 17 Jun 2015 14:05:37 +0200 To: PHP Development Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) X-Mailer: Apple Mail (2.2098) Subject: Revisit trailing commas in function call parameters? From: cschneid@cschneid.com (Christian Schneider) 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 = enough 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 = flame 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: =20 argument_list: '(' ')' { $$ =3D zend_ast_create_list(0, = ZEND_AST_ARG_LIST); } - | '(' non_empty_argument_list ')' { $$ =3D $2; } + | '(' non_empty_argument_list possible_comma ')' { $$ =3D = $2; } ; =20 non_empty_argument_list: