Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120184 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92433 invoked from network); 2 May 2023 19:07:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 May 2023 19:07:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5F4D61804AA for ; Tue, 2 May 2023 12:07:08 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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, 2 May 2023 12:07:07 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 67EA45C025F for ; Tue, 2 May 2023 15:07:07 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Tue, 02 May 2023 15:07:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1683054427; x=1683140827; bh=Q+GSNTNKkW Fj1DCwm1hytyVQ//kqhAHlEC4X6qLCLNQ=; b=MmU5M2oUyYmnvQJzIkjjmWjpMR ZG4zhnHQpFuoSaYR95Dz2ZJ0RtagN8MAfP/h2a4iSGtjE0jHpxidK7TV0Jmve2B1 aN/U6beycYzLwpmximVwDFc7cQIk30J4zqq+GDKSsZroUTftmC+aVFnQ1VgdTTIH RWuLK+8mXiTed3f2XuDBMFb2+g2ikPBn/TgujF6futOJJ+vx/8QCl7SS5X9el2qJ fSXNiHntFppdyWShdEpgNujsKDBrd1LFHwV1spTaPQMga0H7Bp37FhMCeHoZXZw0 JCHPmOsmmlQjCez240nghGgtXAVWRI0PUhHeCl9HeEqaH3mqoz7U7czXwYhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1683054427; x= 1683140827; bh=Q+GSNTNKkWFj1DCwm1hytyVQ//kqhAHlEC4X6qLCLNQ=; b=A K6+fPJfWOFbt3Y3HMH9erLMd4l/ywPhnuE3n+B487V3j5BJH0mG3C31RnqQJLWku tC8KEhvaZD4cfCvMaKEVNTdXmQfszRF0YnB4cPz7TwQ83PVd4djmKvoATHrR5mCC POVw7nhhHy+JQEiDXPsepUvaPr+om11aeA1ZCpn7YgEGTG7Xv3x0+FgJ/nYNmH4/ 8A9k3U+KMDqfOSfjOnglaZJXDsnBRMmOLD4Uxvlo7b1RX/bGMyz/O4H9Ue0140cG ox5c2q7YOGdllNBSK3pAWJaf2TIX0xVfLFS3LieJyi37li28+giSWpHL6oe4O2EQ QmXzPVaRbeffEPShqYvvQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedviedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfn rghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrd gtohhmqeenucggtffrrghtthgvrhhnpeffffffjeffudfggeevvdeitdetvdfgjefffeff jeelfeejteevheeghffhvdfgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 267251700090; Tue, 2 May 2023 15:07:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-386-g2404815117-fm-20230425.001-g24048151 Mime-Version: 1.0 Message-ID: In-Reply-To: <6cab1982-3323-25c4-b670-95798b176b09@bastelstu.be> References: <6cab1982-3323-25c4-b670-95798b176b09@bastelstu.be> Date: Tue, 02 May 2023 19:06:44 +0000 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: larry@garfieldtech.com ("Larry Garfield") On Tue, May 2, 2023, at 5:05 PM, Tim D=C3=BCsterhus wrote: > Hi > > On 5/2/23 13:37, Dan Ackroyd wrote: >> For the functions that are having new separate methods added, not >> deprecating them immediately makes upgrading easier. When upgrading >> from one version of PHP to the next, it is best if you can run the >> same code on both versions, without any deprecation notices going off. > > Agree here, I consider it a good thing if there's at least one version=20 > where both alternatives exist and are fully supported (i.e. without=20 > emitting a deprecation notice). > > As an example, with PHP 8.3's addition of Randomizer::getFloat() and=20 > Randomizer::getBytesFromString() there are useful replacements for=20 > lcg_value() and uniqid() [1] respectively, but I'm intentionally not=20 > proposing deprecating either of them before whatever comes after PHP 8= .3. > > [1] The latter of which is likely one of the most misused functions in= PHP. > >> Would leaving the current versions in place and working actually cause >> any maintenance issues? >>=20 >> If not, then we could just move really slowly on deprecating them. We >> could deprecate them at some point in the 9.x release cycle and remove >> them in 10.0. > > Does it necessarily follow that a function that is deprecated in major= X=20 > must be removed in major X+1? Otherwise deprecating with 8.3 and=20 > removing in 10 would be an option that could be evaluated when it's ti= me=20 > for 9 and the migration did not yet "sufficiently" happen in userland = code. > > I can also see how that would be useful for the planned deprecation of=20 > rand() and mt_rand(). Both of them have overloaded signatures, but wil= l=20 > be part of the other deprecation RFC, as they also have a myriad of=20 > other issues that I consider to be worse than the signature.=20 > Unfortunately they are pretty ubiquitous, but luckily do not cause=20 > "internal" maintenance problems. So it would likely be feasible to kee= p=20 > them until 10, as long as they emit the deprecation notice to slowly n= ag=20 > developers away from them towards better alternatives. > > Best regards > Tim D=C3=BCsterhus Given past pushback on changes that we've gotten, a low-cost/no-cost lon= g deprecation period seems like it would be very appreciated. I've actually been considering proposing an RFC to mandate a minimum tim= e length between deprecation and actual removal/change for that reason. --Larry Garfield