Yo-An Lin wrote on 05/06/2015 06:51:
Laruence <laruence <at> php.net> writes:
On Fri, Aug 30, 2013 at 11:23 PM, Nikita Popov <nikita.ppv <at> gmail.com>
wrote:
Hi internals!
This RFC proposes to add a syntax for argument unpacking:
https://wiki.php.net/rfc/argument_unpacking
Basically, this is the "complement" of the variadics RFC: It is not about
declaring variadic functions, but about calling them.
The syntax it introduces looks as follows:
$db->query($query, ...$params);
seems so weird and ugly..
-1
I totally agree.. the syntax design doesn't look quiet right. it isn't
readable and ugly.
Since it's unpacking the arguments from the caller, the "..." should be put
after the $params. e.g.
$db->query($query, $params...);
the above approach is also used in Go.
Not sure why you've picked this up now, but the mail you're replying to
is from nearly two years ago, and the syntax in question was accepted,
and released as part of PHP 5.6.0 in August 2014. The documentation can
be found here:
http://php.net/functions.arguments#functions.variable-arg-list
So it's far too late to change the syntax, even if we had a better
reason than "it looks nicer to me with the ... the other side of the name".
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php