On Mon, Sep 23, 2013 at 11:18 PM, Robert Stoll wrote:
> Personally I would allow multiple unpacking but not allow unpacking for
> non-variadic parameters thus:
>
> function foo(...$arr){} foo(...$arr, ...$arr2); //is fine
> function foo(...$arr){} foo(1, 2, ...$arr, ...$arr2); //is fine
> funct
> -Original Message-
> From: Lars Strojny [mailto:l...@strojny.net]
> Sent: Monday, September 23, 2013 9:37 PM
> To: Nikita Popov
> Cc: PHP internals
> Subject: Re: [PHP-DEV] Argument unpacking - Multiple unpacks and trailing
> arguments
>
> Hi Nikita,
On 23/09/2013 21:19, Nikita Popov wrote:
That's a general issue that's not really related to multiple unpacks. It
could just as well happen without any unpacks at all ( f(a => 'a', a =>
'b') ) or when unpacking an iterator (which is allowed to have duplicate
keys).
Fair enough. However, I'm a l
On Mon, Sep 23, 2013 at 9:45 PM, Andrea Faulds wrote:
> On 23/09/2013 20:33, Nikita Popov wrote:
>
> The main open question (or at least the focus of the discussion) seems to
>> be whether to allow multiple unpacks and trailing arguments.
>>
>>
> I'm not sure I like the idea of multiple unpacks,
On 23/09/2013 20:33, Nikita Popov wrote:
The main open question (or at least the focus of the discussion) seems to
be whether to allow multiple unpacks and trailing arguments.
I'm not sure I like the idea of multiple unpacks, were we to implement
named parameters (if you did f(...(['a' => 2]
Hi Nikita,
Am 23.09.2013 um 21:33 schrieb Nikita Popov :
[...]
> An example of trailing arguments are array intersections and diffs using a
> custom compare function:
>
>array_uintersect(...$arrays, $compare);
>array_udiff(...$arrays, $compare);
>// also array_intersect_uassoc and all
Hi internals!
I'd like to finish up the argument unpacking proposal (
https://wiki.php.net/rfc/argument_unpacking).
The main open question (or at least the focus of the discussion) seems to
be whether to allow multiple unpacks and trailing arguments.
An example of multiple unpacks is the bind()