RE: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2

This is only part of a thread. view whole thread
April 5, 2019 09:04 (=?utf-8?b?Q0hVIFpoYW93ZWk=?=)
The [original argument unpacking RFC]( does allow positional arguments after unpacking, but later it's changed due to some implement issue, see

I didn't see the same limit exists for arrays, so I didn't include this rule in my RFC. 

CHU Zhaowei

-----Original Message-----
From: Claude Pache> 
Sent: Friday, April 5, 2019 4:04 PM
To: Stijn Peeters <>
Cc: CHU Zhaowei <>; PHP internals <>
Subject: Re: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2

> Le 5 avr. 2019 à 09:45, Stijn Peeters <> a écrit : > > Hi, > > If I understand correctly it is possible in this proposal to use normal arguments after using an unpackable argument: > > $arr4 = array(...$arr1, ...$arr2, 111); //valid > > This is something that is not possible when using argument unpacking in function calls: > > $result = someFunction(...$arr1, ...$arr2, 111); //invalid > > While I personally like the more permissive variety in this RFC, I think this could be a confusing inconsistency, and for clarity's sake it would be better to keep both instances of the unpacking syntax as consistent with each other as possible. > > Best, > Stijn > >
That begs the question: why is this invalid for function calls? In fact, I am able to easily hack around the limitation: $result = someFunction(...$arr1, ...$arr2, ...[111]); // valid but the limitation seems just an unnecessary annoyance. —Claude