Re: [RFC][List/Assoc\unique]
| From: | Tim Düsterhus | Date: | Thu, 01 Dec 2022 18:38:44 +0000 |
| Subject: | Re: [RFC][List/Assoc\unique] | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119072@lists.php.net to get a copy of this message | ||
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