Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130229 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 0C3021A00BC for ; Mon, 2 Mar 2026 22:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772489709; bh=42zE88Sako2YUfx0/Qv1QOpa23DGyKWABQ+0vd6leeQ=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=ef9J6gZ66LZumn+fV7f27ngpZ4LxsVck8zLvGEAVgzxCbB2mtbndtKXajKOnij0o2 il+X57ox2mRpbYt0fta2H964jWoVVupTlpe9ce0eMEgIluHVNLcQkPwqY/Nsgd/BhC dNM2xTMzaqnFL1VuD7uhrWCfvttVWXNO3xQC51CN7WYInSCtnrAlCkX8TRdX/XSnrK LmLNqf8r8pXoy4TmugCDW1cHejP06Nf27x8HpjfFJfKSF/E9z8L8h54VO6c8+MGYoO F33cbazoMWXwwMuFc3V704ZkPEMRZRfK3wdcMCKUMFNc5SRY0G/KzBDLvT6/roGSzo voYPutUWUQ6Pg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C83A1805E7 for ; Mon, 2 Mar 2026 22:15:08 +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=3.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail.xdebug.org (mail.xdebug.org [176.126.244.128]) (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 ; Mon, 2 Mar 2026 22:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772489699; bh=42zE88Sako2YUfx0/Qv1QOpa23DGyKWABQ+0vd6leeQ=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Xj4jobIOoASV8VhQZTaUp1OChUrEo96Ip2/jJWirvxSIeMcPMK0MFUN2iZwzm1gDm jTvZ2au9a0dv9a/CPYaGBG49QeE77CPTpVQWWcekfYH3yhqac3k9/CLt4BIEasuXwQ +/IsuTpj8jXlUaPJFa00UT8eSmQw17LaEp3lmg1CGeVZwdYaBIdfG4FcdNEsA/adxt fansdzXTq7bmVKMJtPmR7Qa68E339lNTbakr39QfYuQC267vpnonSiATDaofCeIqwM I3MFHc73UmH1SY5wvph2Tv2mXyllpp8BBtrLWis84sGP318Vwwl5Cnoj166jfqMekf 6uFPdbIwqhz+Q== Received: from ehlo.thunderbird.net (host109-146-248-81.range109-146.btcentralplus.com [109.146.248.81]) by mail.xdebug.org (Postfix) with ESMTPSA id 28EAB200C9; Mon, 02 Mar 2026 22:14:59 +0000 (UTC) Date: Mon, 02 Mar 2026 22:14:58 +0000 To: Bob Weinand CC: =?ISO-8859-1?Q?Tim_D=FCsterhus?= , PHP internals Subject: Re: [PHP-DEV] [RFC] enum SortDirection User-Agent: K-9 Mail for Android In-Reply-To: References: <5bec7fdd-e2d0-47ab-92d0-ead8eade21e6@bastelstu.be> Message-ID: Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: derick@php.net (Derick Rethans) On 2 March 2026 21:43:19 GMT, Bob Weinand wrote: >Hey Tim, > >On 2=2E3=2E2026 21:45:39, Tim D=C3=BCsterhus wrote: >> Hi >>=20 >> please consider this email as a formal request for comments on my modes= t proposal of adding a new `enum SortDirection` to PHP=E2=80=99s standard l= ibrary=2E >>=20 >> I have made the full proposal available on the World Wide Web at: >>=20 >> https://wiki=2Ephp=2Enet/rfc/sort_direction_enum >>=20 >> Yours sincerely >> Tim D=C3=BCsterhus > > >That's a good idea, but I wouldn't introduce such class without some usag= es at least=2E > >I'd recommend considering immediately upgrading the proposed functions to= use SortDirection and redefine the constants in terms of the enum=2E > >I=2Ee=2E set const SORT_ASC =3D SortDirection::Ascending; - similar for o= thers like the SCANDIR_SORT_DESCENDING etc=2E=2E > >This is a reasonable BC break, which is also trivially fixed by simply ac= cepting int|SortDirection in existing functions=2E If its a BC break, it can't go into a 8=2E=C3=97 for something that isn't = *necessary*=2E But I also don't see how accepting both int and this new enum for existing= built-in functions is a BC break=2E Changing the existing constants to something else is probably not a good i= dea, as other user functions or libraries might have reused them=2E=20 cheers Derick