Re: Array spread append
| From: | Michał Marcin Brzuchalski | Date: | Thu, 06 Apr 2023 15:01:36 +0000 |
| Subject: | Re: Array spread append | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119827@lists.php.net to get a copy of this message | ||
czw., 6 kwi 2023, 13:53 użytkownik Vorisek, Michael <vorismi3@fjfi.cvut.cz>
napisał:
> Hi Ilija,
>
> * Are integer keys preserved? I'm assuming no, as otherwise it would
> be the same as
$a + $b.
>
> $arr[...] = $arr;
> should be the same as
> foreach ($arr as $v) { $arr[] = $v; }
>
I'd argue with that because I think the spread operator should be
consistent with preserve keys strategy used in other places.
Cheers,
Michał Marcin Brzuchalski
>