On Wed, Dec 2, 2020 at 10:46 AM G. P. B. <george.bany...@gmail.com> wrote:
> The reason why this has been deferred is because of which semantics should
> be used for duplicate string keys.
>
> Do we use the addition between two arrays semantics or the array_merge()
> semantics? See: https://3v4l.org/7QbWv

array_merge is the only one that makes sense.  Addition of positional
arrays is nonsensical:
    [1,2,3] + [4,5,6]  ===> [1,2,3]

As for named keys, every other language with a similar construct
(perl, python, javascript) uses array_merge semantics.  Truth is I'm
sorely disappointed that + works like it does, but there's no fixing
it now.

--c

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

Reply via email to