Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128967 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 25BEC1A00BC for ; Sat, 25 Oct 2025 21:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761426080; bh=jWkB5YZEiMd2awZylsNt4CfUpcc806MqFG13jYr7tH4=; h=References:In-Reply-To:From:Date:Subject:To:From; b=apjjHsdSs+LEKXYKv1JPs5Qfb+wnsCeJqEyCAoJwDyW23L5xYakT1TBfr5Ojzg9bD xqG/YCLTlqFtLsjN+Ye/iDEdIiwvcHqqoUfKDNGN+NFbDJPtnXW/pTvg7KyOl8+Ncj B58qfSspcwF+3TuNyPAlxyE10pER0mw18rDlDfT8Vi3rXh+xrKIlQIZcxjxSDOIgOr 0TSfymgYeI3D8EfaUaWmjB2dleFJ2TPV66Aola5d273qxThrkAjfl3/ifDI0hf95C6 TWCqZQMW2okr43XXd2Si61nw86/Zsfbq624mumM8c0ysb6qisllsFbVpInh7lNrq6W 2kxP/PVst6m5g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0229180055 for ; Sat, 25 Oct 2025 21:01:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 25 Oct 2025 21:01:16 +0000 (UTC) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-781014f4e12so40786317b3.1 for ; Sat, 25 Oct 2025 14:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intuitivetechnology.com; s=google; t=1761426071; x=1762030871; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=lZXHw1LC3WAzF+zfIEbTm+2iLBGXt4hUZvnNBJZ01Ek=; b=aSIV7qs5YdSkX07TzQHqFrlwRu83NR+6qDRougVoX3C9JG+XFjyvemsqR3iQvAa9H6 Nb8ISCLfAm9+JmGxH3yVehePMhBu917pm/tGInNpqwjisB6PbJBRRx5V9zx5VqMgsHav iy3C0G9uAo4mVKA10YkTwbEJsX6CDGYdoFwYoFuGueMEm/dfd3hULBwtopzomH8ez8cD Dxb5PWeDsP/7HpM+UkQc14/cEydKQ7KebyyD6ZWbjUT/VIxYM4BN/80yqoMzcg7oUG9L AMkccfBA0apeUMPGW6+27ZpF1WlFXfBJZUsjL4COZ0DkNTqP41xG2gdNEkuvr2HVaGbX VYzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761426071; x=1762030871; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lZXHw1LC3WAzF+zfIEbTm+2iLBGXt4hUZvnNBJZ01Ek=; b=d4rw722BK1Zt0W7rR6A6Dy41MgifzwIXQNmDlrRLbvSduXP60meifnLvbEk2P05Eha eugSRCBoW6XBDAdgzd45V6GIdo9qSNU9xMFeg4baxFtPisxgden2y5hyr0y+4UeRye3S y1T9CKuSUBMeVmsJO5raMXg3JHgvvrohuhf2aXsKwufKwLd3vlQfdg6xrQ86YhPfOK3q Vx6X3/fobCrGUZhW83NMAcLvnj1+c3zAp3PG6JH9ro5bN10VBOfb30LCcxOzyfuy6BMU x/BajXCMbwpHjDWoA+BrD29uzSyY6dJcYMs1bL6puFfsESm2l076G03U81jvZOPcMGqo jhgg== X-Gm-Message-State: AOJu0Yw7ZQ6qY/GBJTO6vTuN8D1C0OgCSPqiv4404648zhTIyCHV9x70 QDy3HunndkO8t6BtyIssQRSOxXUH5Lf8OZFPDplVHWmRG1OARBo2FfkAaB0ZmhECiwUd0pcfoyG TKzJi13IVkD9Q+y0e7M/q1ffD8+7eu1g3WvwT2XzRLEJ+N0hXhzSXN10= X-Gm-Gg: ASbGncvhAxoal6Cu+wbR+am6siUmOB99s/MX4zarsaX2K8zXAk2IBd4PCk+F0qM6WZ5 9zDF2RrzwW+SFAb4k7bBlayrLo92UEZrBnlPaJciczcf5AoESobdUIJKYCPpcQJ0/BOyShjeiLs rOkvjyFUp1+apiaoMoYlp+4kOuh8wGJ4WullUjdgi/dCh8bImbkpyeoKNzYz3pAWOF4KUE6shhI 8no4F0UhNCqJwiDzDVFBMjF4UKTHJLmy0CAz8n8AXigjYIETJUbhAP2dMVDMGm7+Jo3djXK X-Google-Smtp-Source: AGHT+IEtOJehxo14i/azijwGyfsh8wp31zb+Q1OGV8kjSuPppvO7m7Rsz0ViI9SKKkrpG7dcMyrlTWLgKevth2OVUJw= X-Received: by 2002:a05:690c:9a12:b0:781:2a1:f4da with SMTP id 00721157ae682-7836d34df61mr274221807b3.48.1761426070777; Sat, 25 Oct 2025 14:01:10 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <48b2d4f5-2baa-4dac-9f13-163ac68a4adf@app.fastmail.com> In-Reply-To: Date: Sat, 25 Oct 2025 14:01:00 -0700 X-Gm-Features: AWmQ_bnV3k8sMyuW5Bjg0HvHHNyQ_UzXZTlPj84HfxvrpWb0oHm3Xwd5iVoIu0U Message-ID: Subject: Re: [PHP-DEV] RFC proposal for adding SORT_STRICT flag to array_unique() To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000003f4d4c064201f7e5" From: jmarble@intuitivetechnology.com (Jason Marble) --0000000000003f4d4c064201f7e5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Rob has convinced me SORT_STRICT is semantically incorrect. I agree SORT_BINARY has merit, though I'm having difficulty with the implementation= . I think I got too focused on _convention_ wanting to align naming convention with the existing SORT_* flags. But a perfectly acceptable alternative exists, ARRAY_UNIQUE_STRICT. I'm aware of the previous effort (https://externals.io/message/118952) made regarding the flag ARRAY_UNIQUE_IDENTICAL. While this is technically correct and follows existing convention (e.g. ARRAY_FILTER_USE_*), I personally feel it's a bit awkward. ARRAY_UNIQUE_STRICT is, I think, a bit more intuitive. Especially today, as `declare(strict_types=3D1)` has become more common and even encouraged, particularly for those who love PHPStan level max haha. Pull it, test it, break it. Let's do this! https://github.com/php/php-src/compare/master...jmarble:php-src:feature/arr= ay-unique-sort-strict On Sat, Oct 25, 2025 at 7:41=E2=80=AFAM Morgan wrote= : > On 2025-10-26 00:16, Rob Landers wrote: > > > > > Object identity and value are different things... https://3v4l.org/uZTs= N > > > > > > > $white =3D=3D new Color("white") > > That's comparing the values of the objects' properties (which may or may > not be relevant to its "effective value" - the comparison applies to > private properties as well) and considering the aggregate to be the > "value of the object". > > Regardless, the comparison is certainly not useful to me (where > recursively grovelling around in the objects' properties would be > prohibitively expensive if not fatal), and doesn't make array_unique() > any more helpful in deduplicating. > --0000000000003f4d4c064201f7e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Rob has convinced me SORT_STRICT is semantically incorrect= . I agree SORT_BINARY has merit, though I'm having difficulty with the = implementation.

I think I got too focused on _convention_ wanting to= align naming convention with the existing SORT_* flags. But a perfectly ac= ceptable alternative exists, ARRAY_UNIQUE_STRICT.

I'm aware of t= he previous effort (https:/= /externals.io/message/118952) made regarding the flag ARRAY_UNIQUE_IDEN= TICAL. While this is technically correct and follows existing convention (e= .g.=C2=A0ARRAY_FILTER_USE_*), I personally feel it's a bit awkward.
=
ARRAY_UNIQUE_STRICT is, I think, a bit more intuitive. Especially=C2=A0= today, as `declare(strict_types=3D1)` has become more common and even encou= raged, particularly for those who love PHPStan level max haha.

Pull = it, test it, break it. Let's do this!
https://github.com/php/php-src/compare/master...jmarb= le:php-src:feature/array-unique-sort-strict

On Sat= , Oct 25, 2025 at 7:41=E2=80=AFAM Morgan <Weedpacket@varteg.nz> wrote:
On 2025-10-26 00:16, Rob Landers wrote:

>
> Object identity and value are different things... https://3v4l.org/uZTsN<= /a>
> <
https://3v4l.org/uZTsN>
>


=C2=A0 $white =3D=3D new Color("white")

That's comparing the values of the objects' properties (which may o= r may
not be relevant to its "effective value" - the comparison applies= to
private properties as well) and considering the aggregate to be the
"value of the object".

Regardless, the comparison is certainly not useful to me (where
recursively grovelling around in the objects' properties would be
prohibitively expensive if not fatal), and doesn't make array_unique() =
any more helpful in deduplicating.
--0000000000003f4d4c064201f7e5--