Hi

On 12/1/22 19:22, Ilija Tovilo wrote:
https://wiki.php.net/rfc/list_assoc_unique

This RFC proposes adding two new functions, List\unique() and
Assoc\unique() as alternatives using strict equality (===) semantics,
the former discarding and the latter preserving keys.


I believe this would be better solved as part of the more generic "expanded iterable helper functions" proposal (which I really hope makes it into a proper RFC that is accepted):

https://externals.io/message/118896

Deduplication is reasonably well-defined for arbitrary iterators (even infinite iterators) and I don't think iterators (esp. Generators) should remain second-class citizens to arrays going forward.

Side note: I *really* hope the discussion will be about more than just
the namespaces.


In addition to the reasons above: Yes, adding two new single-function namespaces IMO is not a good thing, because it only adds to the inconsistency. Adding new namespaces should be part of a "bigger picture".

Best regards
Tim Düsterhus

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

Reply via email to