Re: [RFC] Spread Operator in Array Expression v0.2
| From: | Stijn Peeters | Date: | Fri, 05 Apr 2019 07:45:23 +0000 |
| Subject: | Re: [RFC] Spread Operator in Array Expression v0.2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105094@lists.php.net to get a copy of this message | ||
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
Op 4 april 2019 bij 16:15:16, CHU Zhaowei (me@jhdxr.com(mailto:me@jhdxr.com)) schreef:
> Hi internals,
>
> Thanks for the people who joined the discussion of my [RFC: Spread Operator in Array
> Expression](https://wiki.php.net/rfc/spread_operator_for_array). The biggest change is I have
> dropped the support for string keys in v0.2 as suggested by Côme, to make the behavior of spread
> operator consistent. I have also added Q&A to explain the questions I received.
>
> Thanks & best regards,
> CHU Zhaowei
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>