Re: [RFC] Spread Operator in Array Expression
| From: | Nikita Popov | Date: | Wed, 21 Nov 2018 19:30:57 +0000 |
| Subject: | Re: [RFC] Spread Operator in Array Expression | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103473@lists.php.net to get a copy of this message | ||
On Mon, Nov 19, 2018 at 9:26 AM CHU Zhaowei <me@jhdxr.com> wrote:
> Hi internals,
>
> I'd like to start the discussion for [RFC: Spread Operator in Array
> Expression](https://wiki.php.net/rfc/spread_operator_for_array). In
> short, this is a syntax similar to argument unpacking, but for array.
>
> You can find the implementation [here](
> https://github.com/php/php-src/pull/3640). It's still WIP,
> but I'll
> finish it in the next following weeks.
This looks reasonable to me. The array_merge() behavior is certainly the
one I would (in PHP) expect intuitively, and it is likely the most useful
one as well, striking a balance between behavior useful for pure vectors
and pure dictionaries (and falling short if it's not either ... as is usual
in PHP).
Nikita