Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118541 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37238 invoked from network); 30 Aug 2022 14:25:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Aug 2022 14:25:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A0281180553 for ; Tue, 30 Aug 2022 07:25:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 30 Aug 2022 07:25:12 -0700 (PDT) Received: by mail-qk1-f177.google.com with SMTP id c9so8490986qkk.6 for ; Tue, 30 Aug 2022 07:25:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc; bh=wWSJRzt2lYqU4oIBBhmzHX5C9B3Md4TMj367RtdyY9k=; b=CSxtkcymXaYIwWA4eYXFFFJUxXR2D4kKXxk4To4AK1XGt7kGnABqPMsLu0DnXKovRX eQewnKKagLanJ05Qh9jM4VgfCl5lbV4QSmL+xRS88Ib9B7lGvaRVaHFGpQtTpj76L+xV p0k0e2Him5JbynslImIo4wkLrVH+ArjrnOBGwsT/hRgsZp1zG0P+v4ONdvh32J48R6WQ AXL4MXDjNTOt8Pu1GUdxQhPd92LVdnqsIxvyeX8X4mwFO8W9m607+zTrJhpiMXgKLoCV ShwcXltchx7XXQttudL1sst7Ndd9LuLtPlTCcVzJIcVsKBIhIrhu1ncl90NWsxrgN61X RZ9g== X-Gm-Message-State: ACgBeo0fSmstByMHm2JRWVvCI5kAXmqFvhPcKarkYDrJJ8U6m8bXBl39 e8Lz/HfC70YJQ7jwswVyhGFCEQ== X-Google-Smtp-Source: AA6agR5YBJM6P3zKWltZmgv+kaegXbmSnU8QlMXYKHtnX6rNloNm+wr5Bn2S9iJAclr9Al8kJQ3rpg== X-Received: by 2002:a05:620a:2710:b0:6b5:bf24:10e9 with SMTP id b16-20020a05620a271000b006b5bf2410e9mr12168404qkp.28.1661869511125; Tue, 30 Aug 2022 07:25:11 -0700 (PDT) Received: from smtpclient.apple (h96-61-105-82.lvrgtn.broadband.dynamic.tds.net. [96.61.105.82]) by smtp.gmail.com with ESMTPSA id f15-20020ac86ecf000000b003445d06a622sm6901579qtv.86.2022.08.30.07.25.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2022 07:25:09 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_7DCFDCD3-650F-41AB-9D99-E16C6F37C305"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: Date: Tue, 30 Aug 2022 09:25:07 -0500 Cc: Sara Golemon , Patrick ALLAERT , Go Kudo , PHP internals , Gabriel Caruso Message-ID: <47B19B34-6BBA-4B2F-BDEA-1F5B7036548A@php.net> References: <355260c3-880f-a497-698f-c12175192485@gmx.de> To: "Christoph M. Becker" X-Mailer: Apple Mail (2.3696.120.41.1.1) Subject: Re: ksort breaking change From: ramsey@php.net (Ben Ramsey) --Apple-Mail=_7DCFDCD3-650F-41AB-9D99-E16C6F37C305 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 29, 2022, at 05:48, Christoph M. Becker = wrote: >=20 > On 26.08.2022 at 18:28, Sara Golemon wrote: >=20 >> On Fri, Aug 26, 2022 at 7:19 AM Christoph M. Becker = >> wrote: >>>=20 >>> On 26.08.2022 at 05:15, Go Kudo wrote: >>>=20 >>>> In the actively supported version of PHP, `ksort()` has been = modified to >>>> include BC Break. >>>>=20 >>>> https://github.com/php/php-src/issues/9296 >>>>=20 >>>> This may seem like an appropriate bug fix, but it is a clear BC = Break. I >>>> think this change should only be introduced in PHP 8.2 and later. >>>=20 >>> In this case, the functions didn't behave as documented, namely to >>> conform to the general conversion rules, which had a relevant change = in >>> PHP 8.0. Apparently, this case has been overlooked when the change = had >>> been implemented, and only been noticed recently (what still = surprises >>> me). Anyway, fixing the issue now is not really introducing a BC = break, >>> since code relying on the previous behavior did not conform to the >>> documentation. >>=20 >> What I can see is two noble, but conflicting ideals: >> 1/ sort() and ksort() should be consistent about their sorting = algorithms. >> I think we can all agree about that in the ideal case, at least. >> 2/ Behavior within a minor release should be self-consistent and >> predictable. >>=20 >> Knowing the discrepancy exists in current releases of 8.0.x and = 8.1.x, >> we're currently in a position where ideal #2 is satisfied, but ideal = #1 is >> failing in a small, and subtle way. The potential consequence of = this is >> sites out there where the inconsistency shows through to end users = (though >> I wouldn't actually expect any breakages as a result, just = clowniness). >>=20 >> With the recently applied patch, we would resolve ideal #1, but we = would do >> so at the cost of ideal #2. It's doubtful this will actually break = any >> code either, but potentially user-facing affects could be visible, >> especially in a mixed-version environment (such as during a rolling >> upgrade). >>=20 >> Given the above, my initial inclination is to err on the side of >> conservatism for 8.0.x at the least (we're nearly at the end of our = primary >> bug-fix cycle anyway) by reverting the fix on our branch. >> For 8.1, I think we have a more difficult decision to make with over = a year >> of bug-fix releases to go, and I might be swayed to keep the fix = around >> there. >=20 > I have reverted the commit on PHP-8.0 just now. Please don't forget = to > revert on PHP-8.0.23. >=20 >>>> Fortunately, there is not yet a release in each version that >> incorporates >>>> this change. I think it is possible to revert now. >>>=20 >>> Well, the fix is part of the currents RCs; that doesn't make it >>> impossible to revert, but RMs should have a say in that. Thus I'm >>> adding Sara and Gabriel as recepients. >>=20 >> Don't forget Ben and Patrick as well, this impacts 8.1 equally. >=20 > Yeah, would be good to hear whether the commit should be reverted on > PHP-8.1 as well. I decided to revert this in PHP-8.1 and PHP-8.1.10 branches, as well. Cheers, Ben --Apple-Mail=_7DCFDCD3-650F-41AB-9D99-E16C6F37C305 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEObZBND2MEEsrFG3D+cOdwLlphUQFAmMOHcMACgkQ+cOdwLlp hURb0A//TmPyi1+8iMd2QoRLuTB6xEMwaj5IPnXwdl3F3Yc8w1MOgc3R44P1ZTdM pBL9rUVLIdFlOuFvgeAGnc9Aoo8Q3zWUhDZ4G1qncXYNKedFvqmHlwmFwrRA64JS geL+NPVOnZG3rH1iQDQ1uOHDClX6JGvPimn6e4ocAKgRficnHWwdCQ6QnhqeNkYw 8fRjV5TC9uAi/XwYW4+YOtQ5dmnRx84NCmQlfzGt+TSJ5ViMfQbLQ4urDIqLEl04 be3VD/z/B49H6zYmTTV7ONBoAQrloO3/4FOaaRSqWKqAizdaoi5SRYW107CdFRYk mL0+OXMVUr+JJ/USQz2K3MhkRWkwK3oTfj1NCVQViwnz21UiLAFATKO0bOHROtoy HtPUAY2i2C9vNg4Bco0E5ceDf4/RsHf2++10XuVMjBPFSRtN2vptgINn/ChXfnNb ebYumz6QVPs1eEfQu953+/zlUNMi0G4xJtVHt1vua16ijv01DveXEeqy6cA0wnDB kLX/K5o4vxh9V/bweWYN4BfBW99Snr1PRtB8QbUsHNFEpYU30ZJfpGPHy0B+eZqe J6YRQHn9MiaXoavrDgT1FK2oQhZN9kzUaaW0oroAiNaQFvg92g+RiM1W8O6fOv8U lkVQ2w0zBGf8EFQI2nkjKsJ6Wx11WPcTQW79GRoixiB64BlBUWM= =7nrE -----END PGP SIGNATURE----- --Apple-Mail=_7DCFDCD3-650F-41AB-9D99-E16C6F37C305--