Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119091 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70699 invoked from network); 5 Dec 2022 18:52:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Dec 2022 18:52:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E1ED1804B0 for ; Mon, 5 Dec 2022 10:52:26 -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=0.8 required=5.0 tests=BAYES_50,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS14618 54.204.0.0/15 X-Spam-Virus: No X-Envelope-From: Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) (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 ; Mon, 5 Dec 2022 10:52:24 -0800 (PST) X-QQ-mid:Yeas52t1670266336t642t43139 Received: from AC5E725682FA4FF3AC37F3EC45C6D546 (me@jhdxr.com [115.66.206.40]) X-QQ-SSF:00100000000000F0FG1000000000000 To: "'Ilija Tovilo'" , "'PHP internals'" References: In-Reply-To: Date: Tue, 6 Dec 2022 02:52:16 +0800 Message-ID: <006901d908da$b23b3e20$16b1ba60$@jhdxr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJjnaxR2v5He4x+QM1VAPNMA9je+q1KcHEQ Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:jhdxr.com:qybglogicsvr:qybglogicsvr5 Subject: RE: [PHP-DEV] [RFC][List/Assoc\unique] From: me@jhdxr.com (=?utf-8?b?Q0hVIFpoYW93ZWk=?=) Hi Ilija, Thanks for the RFC. In general, I like the idea but there are certain = things not clear to me. 1. What will happen if we pass a list to ` Assoc\unique`?=20 ``` Assoc\unique([1, 2, 3, 1]); ``` 2. What will happen if the array (no matter list or assoc) contains pure = value and reference which are strict equal? As the RFC says "references = are preserved."=20 ``` $a =3D 1; $arr1 =3D [$a, &$a]; $arr2 =3D [&$a, $a]; List\unique($arr1); List\unique($arr2); ``` 3. Currently the RFC (proposal section, function signature) claims the = parameter are bool type, which is obvious wrong. But this is just a = minor mistake, what I really want to ask here is do we support array = only or any array like input? > Side note: I *really* hope the discussion will be about more than just = the namespaces. Adding two new namespaces with single function doesn't look good to me, = especially I cannot think of anything that we may add to these two = namespace in the future. Regards, CHU Zhaowei