> On Jun 3, 2021, at 5:31 AM, Lauri Kenttä <lauri.ken...@gmail.com> wrote:
> 
> On 2021-06-03 01:59, Mike Schinkel wrote:
>> 1.) Given Nikita's position that it would only be viable to offer a
>> syntax that simulates method calling for arrays if the methods
>> themselves are immutable can you envision a solution for allowing
>> $array->shift() functionality that would address getting both element
>> and shifted array without resorting to by-reference parameters?
> 
> Spread operator support in assignments would solve this nicely:
> [$first, ...$rest] = $array;

Excellent idea!

Anyone else have thoughts on potential use of the spread/variadic operator in 
array destructuring assignments?

-Mike
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to