Re: [RFC] Spread Operator in Array Expression
| From: | Côme Chilliet | Date: | Thu, 22 Nov 2018 08:17:05 +0000 |
| Subject: | Re: [RFC] Spread Operator in Array Expression | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103478@lists.php.net to get a copy of this message | ||
Le mercredi 21 novembre 2018, 22:46:42 CET Levi Morrison a écrit :
> I think we have
Attachment: [application/pgp-signature] This is a digitally signed message part. signature.asc
+ and array_merge':š}·
> B.œ‚’;>„Á already. What we *don't* have is
> something that concatenates solely with values and ignores keys, at
> least not in a single step. I think ... can be that operator,
> precisely because this is what it does for function calls as well.
For function calls you cannot use it with non-integer keys, the behavior is yet to be defined.
So if later there are named arguments and ... behaves like array_merge on parameters it would be
weird to have it behave an other way on arrays.
I would make the ... operator behave the same in all places, so in array it should refuse string key
as it does for function calls, for the time being.
Côme
Attachment: [application/pgp-signature] This is a digitally signed message part. signature.asc