Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119072 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35042 invoked from network); 1 Dec 2022 18:38:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Dec 2022 18:38:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B31A91804C4 for ; Thu, 1 Dec 2022 10:38:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 1 Dec 2022 10:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1669919925; bh=KxXKjymhXLycCSKRZzQ37G5WgJwR6yQHQlA5j1OWm+s=; h=Date:Subject:To:References:From:In-Reply-To:From; b=NCxICDfehCmcScwoITp4peL4w+x+9XLbQ74wxq9cel4qcLU5D/tAUMf904hfzRu61 PMnddS/DC1Yg8aAsBcQMhHDwlqMproah/nzi4gtcWitvAaGQMXwkT8PqV366CBhGbb FLYnXWlxdPVoPcjs6OcLomQloeBUg+VKrYh/Ip0PgegOQKDw5PAKWA/cRbQCRrXZAa V4SdDWGlwRKKSi2n+dPBL33xFyYvt+5BiRWjNfpXpEqnhjS/uJFquBjmWPybJfc2H+ nb0y0MY1eMyJU2WwIWjVkYWu5lfxzOFNkH/qG//uVyaryryU1qDJ7fEL/zBeyaBfVg 97vlCKGdavpHg== Message-ID: <355b4e04-546d-c587-8da3-05b22001fb89@bastelstu.be> Date: Thu, 1 Dec 2022 19:38:44 +0100 MIME-Version: 1.0 Content-Language: en-US To: Ilija Tovilo , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC][List/Assoc\unique] From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) 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