[RFC][VOTE] Spread Operator in Array Expression v0.2

php.internals

=?utf-8?B?5rGf5rmW5aSn6Jm+5LuB?=

7 years ago
Hi internals, Since there is no more questions for more than one week, I’ve opened the vote on the spread operator in array expression RFC. The vote lasts two weeks and it closes at 7-May. https://wiki.php.net/rfc/spread_operator_for_array#vote Regards, CHU Zhaowei

Levi Morrison

7 years ago
On Sun, Apr 21, 2019 at 1:41 PM CHU Zhaowei <me@jhdxr.com> wrote:
> Since there is no more questions for more than one week, I’ve opened the > vote on the spread operator in array expression RFC. The vote lasts two > weeks and it closes at 7-May. > > https://wiki.php.net/rfc/spread_operator_for_array#vote
I've hesitantly voted yes. I am unsure about the behavior with references. This was brought up during discussion, but never really addressed. It seems that this behavior is the same for `array_merge`. It seems acceptable, though I am unsure if it is desirable or not.

=?utf-8?B?5rGf5rmW5aSn6Jm+5LuB?=

7 years ago
Sorry for the one day delay. This RFC has passed with 43 votes in favor and 1 against. Thanks & Regards, CHU Zhaowei

Nikita Popov

7 years ago
On Wed, May 8, 2019 at 8:15 PM CHU Zhaowei <me@jhdxr.com> wrote:
> Sorry for the one day delay. This RFC has passed with 43 votes in favor and > 1 against. > > > > Thanks & Regards, > > CHU Zhaowei >
I've merged the implementation for this RFC yesterday. However, I would like to propose adding one extra restriction, implemented in https://github.com/php/php-src/pull/4162. Currently, the implementation allows writing things like this: [42 => 0, ...$array] ['a' => 'b', ...$array] I think that with the current behavior of ..., where string keys are forbidden and integer keys are reindexed, it would be best to make these usages illegal as well, at least for the time being. Especially to avoid tying our hands too much when it comes to adding the [$head, ...$tail] = syntax in the future. Nikita