Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123799 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 qa.php.net (Postfix) with ESMTPS id D80881A009C for ; Tue, 25 Jun 2024 00:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719275787; bh=9ooZPLJvUqJ56HdJ5B7q29uPkSAC384nNddOAnrj9Sc=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=KYrF6ovao9JABcXYCn0y8yXDSTK73RIXh6Uhy7ifwcSXwr1iFqOnvq7oxt7vRa8UF wQp6jVe7xvYsuLoQTNJ7V2XGfzhuQwzWwOuMx5wy0SpkhnnT2xGfF+G8onaJFcUNOn ugxUE2fLB6QevUM5ewYHkBSJ0xNtl+85TBKxhcO/RGSf9ko9qVYa3dK1UaUz/fDVpX PGW3mZwFJUAFZOrtthovfKGXDbmKw7I1FpWUQzknS6cngsDjtqF3z2C5oB5Lk9HLtu A9RFFhcX5+MQgd+wFSAQ4VxpeTDxWWQOnbM02yT+S4IW/FS2jntglxYb9HqPVUQ9eh yrjdyLLjoGasQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 45236180511 for ; Tue, 25 Jun 2024 00:36:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_50,DMARC_MISSING, HTML_MESSAGE,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI,MIME_QP_LONG_LINE, MPART_ALT_DIFF,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail1.25mail.st (mail1.25mail.st [206.123.115.54]) (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 ; Tue, 25 Jun 2024 00:36:25 +0000 (UTC) Received: from smtpclient.apple (unknown [49.48.245.122]) by mail1.25mail.st (Postfix) with ESMTPSA id 086A660311; Tue, 25 Jun 2024 00:34:59 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-BDDA40C0-E437-4125-9EF5-FBB285DD4D40 Content-Transfer-Encoding: 7bit Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] Re: [RFC] [Vote] #[\Deprecated] attribute Date: Tue, 25 Jun 2024 07:34:42 +0700 Message-ID: References: Cc: Nicolas Grekas , =?utf-8?Q?Benjamin_Au=C3=9Fenhofer?= , PHP Internals In-Reply-To: To: Matthew Weier O'Phinney X-Mailer: iPhone Mail (21F90) From: php-lists@koalephant.com (Stephen Reay) --Apple-Mail-BDDA40C0-E437-4125-9EF5-FBB285DD4D40 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=
Sent from my iPhone

On 24 Jun 2024, at 23:43, Matthew Weier O'Phinney <mweieroph= inney@gmail.com> wrote:

=EF=BB=BF

On Mon, Ju= n 24, 2024 at 10:08=E2=80=AFAM Nicolas Grekas <nicolas.grekas+php@gmail.com> wrote:


Le mer. 5 juin 2024 =C3=A0 10:18, Benjamin Au=C3=9Fenhofe= r <kontakt@beber= lei.de> a =C3=A9crit :


On Wed, May 22, 2024 at 9= :22=E2=80=AFAM Benjamin Au=C3=9Fenhofer <kontakt@beberlei.de> wrote:
The vote for the R= FC #[\Deprecated] attribute is now open:

https://wiki.php.net/rf= c/deprecated_attribute

Voting will close on Wednesday 5th June, 0= 8:00 GMT.

The #[\Deprecated] attribute has been acce= pted with 23 (Yes) to 6 (No) votes, 79%.


The secondary vote to include Deprecated:= :$since has also been accepted with 22 (Yes) to 1 (No) votes, 96%.


Thank you to everyon= e for voting!


T= im will finalize the implementation PR now and work on its merge in the upco= ming days.


Hi Benjamin,=
<= br>
<= div class=3D"gmail_quote">
<= div dir=3D"ltr">The vote for the RFC #[\Deprecated] attribute is now op= en:

https://wiki.php.net/rfc/deprecated_attribute

Voting wil= l close on Wednesday 5th June, 08:00 GMT.

The #[\Dep= recated] attribute has been accepted with 23 (Yes) to 6 (No) votes, 79%.

=


The secon= dary vote to include Deprecated::$since has also been accepted with 22 (Yes)= to 1 (No) votes, 96%.


Thank you to everyone for voting!


Tim will finalize the implementation PR now a= nd work on its merge in the upcoming days.

=
Since the vote passed, we're discussing how we might use the a= ttribute in Symfony.
2 things on the topic:

1/ We're wondering about using it at the class level despite the miss= ing Attribute::TARGET_CLASS.&nbs= p;ReflectionAttribute does allow reading attributes without checking these flags and we might leverage this capability to make our DebugClassLoader able to inspect=20 those at the class level.
<= br>
Would you consider addi= ng Attribute::TARGET_CLASS in 8.4 already? It would just make sense to me. We don't need the=20 engine to do anything about deprecated classes ever since all we need in userland is a class-loader that checks for the attribute. Keeping the=20 engine simpler and empowering userland with maximum flexiblity FTW. I'm=20 up for a quick RFC if the consensus is this needs one.

2/ About  the "since" parameter, we're going to standardize a= round a package+version string, e.g.
#[Deprecated(since: "symfony/yaml v7.2"]

I'm sharing this hoping this can spread outside of Symfony's boundary=20 because I think this would be a very useful practice that'd allow=20 building nice reporting tools.


Personally, I'd prefer t= he "since" format to mimic the notation that Composer uses on the CLI when s= pecifying a package with a constraint: "symfony/yaml:7.2.0". This can be par= sed easily, and won't suffer from having arbitrary spacing and version namin= g prefixes. 

(Still would prefer a "scheduledR= emoval" field, as knowing when it was deprecated is far less interesting tha= n knowing when it will be removed. Yes, I can assume the next major version,= but what if it's major version + 1? What if a project allows removals durin= g minor releases? Knowing what version it will be removed in makes it far ea= sier to understand what will happen when I upgrade next.)
--

If you're marking a piece of code in  a pro= ject as deprecated, why does the deprecation notice need to re-specify the p= ackage the code is in? Wouldn't a regular version string be sufficient?


= --Apple-Mail-BDDA40C0-E437-4125-9EF5-FBB285DD4D40--