Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7473 invoked from network); 20 Feb 2013 12:46:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 12:46:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.44 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.160.44 mail-pb0-f44.google.com Received: from [209.85.160.44] ([209.85.160.44:57457] helo=mail-pb0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/C0-19387-6B5C4215 for ; Wed, 20 Feb 2013 07:46:46 -0500 Received: by mail-pb0-f44.google.com with SMTP id wz12so2853233pbc.3 for ; Wed, 20 Feb 2013 04:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=esONm/p3g3ijbBfxiv/VoEaDVQ13FWZVb6uAZdmnhwA=; b=HqtHFzBAF707zrnRDa3gu4AinxzUR2zROg7U3WQxXwF7KRPNAoE3t0BjOjOwD3ToYg H20Oya9kE53GHjIbSh0ZrueDUrBQG/H4R68XFv73sYwenEKlXS3TIn1ubSy/IWpRMsn6 4C+v/hW2df1JXT7kbNV6bw7MzD2b0VFo+dDpLdJd7BVW4/0Ha37ZDZyEnEIiplcXeZ+n LqKljFpIu+qSDezALqVwXDhza1XaHsKsS1WsC5nl51cqGaX0AWxDsP70zRVfAjt43K4S 11FrlWIFPI3xkD4iNVScsx/pfiyM820S0FSOvJIms1rPszOb0YM+8w3zh7mXhKZYs7uI GyGA== X-Received: by 10.68.194.226 with SMTP id hz2mr48419819pbc.39.1361364402976; Wed, 20 Feb 2013 04:46:42 -0800 (PST) Received: from [192.168.0.3] (115-64-165-88.static.tpgi.com.au. [115.64.165.88]) by mx.google.com with ESMTPS id rl3sm21576901pbb.28.2013.02.20.04.46.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 04:46:42 -0800 (PST) References: <20130220114733.GM31240@phcomp.co.uk> Mime-Version: 1.0 (1.0) In-Reply-To: <20130220114733.GM31240@phcomp.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <37F31B39-13D1-4BDB-9741-727C7413A490@gmail.com> Cc: Sara Golemon , PHP internals X-Mailer: iPhone Mail (10B141) Date: Wed, 20 Feb 2013 23:46:37 +1100 To: Alain Williams Subject: Re: [PHP-DEV] Re: [RFC] Allow trailing comma in function call argument lists From: davidkmuir@gmail.com (David Muir) On 20/02/2013, at 10:47 PM, Alain Williams wrote: > On Wed, Feb 20, 2013 at 03:26:26AM -0800, Sara Golemon wrote: >> On Tue, Feb 19, 2013 at 4:06 AM, Sara Golemon wrote: >>> Opening RFC to allow trailing comma in function call argument lists >>>=20 >>> https://wiki.php.net/rfc/trailing-comma-function-args >> For the record, I've updated the RFC just now to include >> function/method/closure declarations as well: >>=20 >> function foo( >> $bar, >> $baz, >> ) { >>=20 >> } >>=20 >> Not a pattern I see as much, but for the sake of consistency, it >> doesn't hurt to put it on the table for discussion. >=20 > I would argue against the RFC. >=20 > The trailing comma is useful with arrays since it is not uncommon that mem= bers > need to be added to an array over time. This is often as a result of chang= es > outside of the program (eg: another user added to an ACL). Such a change d= oes > not alter the purpose or functionality that is represented by the array, i= t just > does it for more somethings (users in my example). >=20 > Much source/version control is line based and so trailing commas helps kee= p > differences short. >=20 > With functions: I do not see arguments being added in the same way, ie you= are > getting the function to do more of the same by adding an extra argument. I= f an > extra argument is added it is because what the function does has changed i= n some way. > This is very different from the just-a-bit-more scenario that you have wit= h arrays. >=20 > If a function has a list of arguments that is expected to change, many > programmers would do that by passing an array to the function and arrays c= an > already have trailing commands .... >=20 > Also: many other languages (eg C, Perl) allow a trailing comma in arrays, b= ut > not to function arguments. This change would make PHP different from what m= any > programmers might expect. >=20 > --=20 > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT= Lecturer. > +44 (0) 787 668 0256 http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: http://www.phcomp= .co.uk/contact.php > #include >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 The one place I would find this to be super handy would be when specifying a= rguments to sprintf(), and other variable argument functions. Cheers,=20 David=