Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68642 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5972 invoked from network); 28 Aug 2013 16:32:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Aug 2013 16:32:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:37731] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/61-33204-F162E125 for ; Wed, 28 Aug 2013 12:32:32 -0400 Received: from Hwhost2.local (157-39.6-85.cust.bluewin.ch [85.6.39.157]) by host1.trois-doubles.net (Postfix) with ESMTPSA id 70C1C20C7F6 for ; Wed, 28 Aug 2013 18:32:27 +0200 (CEST) Message-ID: <521E261A.9080706@hoa-project.net> Date: Wed, 28 Aug 2013 18:32:26 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Thunderbird/25.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Syntax for variadic functions From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") On 28/08/13 17:47, Nikita Popov wrote: > Hi internals! Hi Nikita :-), > I'd like to propose an RFC, which adds dedicated syntax for variadic > functions: > > https://wiki.php.net/rfc/variadics > > Basically this allows declaring variadics directly in the function > signature, rather than fetching the arguments using func_get_args(). > Example: > > public function query($query, ...$params) { /* ... */ } > > What are your thoughts on this? Huge +1! So if we call query('foo'), $params is set to an empty array, right? Could it be possible to change this behavior? Would it be interesting? For example: public function query($query, ...$params = null). Cheers. -- Ivan Enderlin Developer of Hoa http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/