Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123800 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 0EAD61A009C for ; Tue, 25 Jun 2024 01:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719278685; bh=An01AjBrBXDRU88+ovzZ+2m2eKHzmB1OcAqJfyiKpIw=; h=References:In-Reply-To:From:Date:Subject:To:From; b=W/hf6FAHwqhbnbTqjn1aQXlhAw4wZX0BCCG9AJWZ0pQmwe5DMtE6mReJOfFhAzPRk 9nchkKmB7xnJDESNRDOKuxKLFfrjVcW6oJma4Qh3ntv9EziZTLnTv8U1VDp2c2Ek8H HTHo3Xtj37yzSrVnF8ZHDi2n4eESxu8xOgQzt7Uu6ykwwvwRCpuG/Pd87xzQzgyNWC SYGJz+mXhIelhSMSXurP4njcUjyZ4mQr7Cp7fPhVTAv5OxGXlIRtYRuaWId7eaHwa2 a0n+pBlpCHiYSDH0bt0lrwvF/MP3DDDq/RLz/5mZxQfE1d+dGJSHqnZZduBKfHHyvv aFhHx5YBJY0oQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8EADF180082 for ; Tue, 25 Jun 2024 01:24:44 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, 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 mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (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 ; Tue, 25 Jun 2024 01:24:44 +0000 (UTC) Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-80f8dc709eeso527978241.3 for ; Mon, 24 Jun 2024 18:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719278606; x=1719883406; 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=cyqtp21u2XN54ea+FJrMOqIM+ISLFLxLCf2qdB6RzCg=; b=FV0gKdSiupv4BLM42Ohg3hFeIEwhfh98ncf1KPA8fZMaY2NhV3T7nwUmWJ5vR2pS3b XhC3rM1taLQc/+vtzeS8v+P2DLGhoBY/AE7qxCTEEiXGwNdMf51We2vuzqAMf2GgpcRn vWc0f6VWIlX7//ti/7t//Mxt5GHWp7Quno8iwlCBMwd5/l01oO8SsGQtXEQi6YpC67uy d64bd2B7WsH11wyhusVlE1FDnMbxnYT04oDqVKGNpwpomexUxrDIJKIsnsXCKB7LLkSi A0+7KJCoq5hVbJl7rtisRthaVuIMIgDN2g88g822JYzceCYpr6Ho5CbyJJmP+VlzhNiN KwVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719278606; x=1719883406; 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=cyqtp21u2XN54ea+FJrMOqIM+ISLFLxLCf2qdB6RzCg=; b=s6JyyoOuCbu/V8+xh4MZuzy1dIeTe+fTtmLcamP9CnOShyyb34RT9OOfaAfYLMPlFr ad/9GPMma3+9iBs1H3ooue5ppU+eAptdYTIQ1dasV9PrUGWgcle/0mA+vJamYX/fyMSC 0KI3TnQrDhh4EzmPxT47qp3ag2TSR5e3TGbhfxKoCLBGJNNJpZyLKIniDuBNFxBTUJsw FEHPN41MlHY8B7VFoizbzvXNEZbhOt3lYPvW69qULMxHAqc70Xe8kVtf7+ZUVjaaA2aX qM9nbmqMJOjMlK9Ww2Hj3cA2OhxNj6jRAAe8Fveyu6O3Glv3XXdXgVnf8nb1RyDJoXEP iBkw== X-Gm-Message-State: AOJu0YzgNypPZDFP1GX8XBQBipRDG8dUf/ugvjEyupgPiP5GFmgbuZsE QU55fxlQzH1NvEdRSgua6eDLJEu8Ye2OtTJQSViiVZ0VjTeRT2A3Qg4YFPgnalgQUO9Y9hogLUE O1rE1OTMtfaxPJNac+CkgYlSUW1ywyw== X-Google-Smtp-Source: AGHT+IE/X+9h4dK9yQprOthgL03jvXjLX4hUwreujAUoZx+gbfVdiQ10GppKFsdncDEhowEcQnge8OKxxcKN5al5UKA= X-Received: by 2002:a05:6122:4a1b:b0:4ec:f018:ee1e with SMTP id 71dfb90a1353d-4ef6a7394ebmr4076409e0c.12.1719278605674; Mon, 24 Jun 2024 18:23:25 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 24 Jun 2024 20:23:16 -0500 Message-ID: Subject: Re: [PHP-DEV] Re: [RFC] [Vote] #[\Deprecated] attribute To: PHP Developers Mailing List Content-Type: multipart/alternative; boundary="0000000000008fb214061bacbecd" From: mweierophinney@gmail.com ("Matthew Weier O'Phinney") --0000000000008fb214061bacbecd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 24, 2024, 7:35=E2=80=AFPM Stephen Reay wrote: > > Sent from my iPhone > > On 24 Jun 2024, at 23:43, Matthew Weier O'Phinney < > mweierophinney@gmail.com> wrote: > > =EF=BB=BF > > > On Mon, Jun 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=9Fenhofer a >> =C3=A9crit : >> >>> >>> >>> On Wed, May 22, 2024 at 9:22=E2=80=AFAM Benjamin Au=C3=9Fenhofer >>> wrote: >>> >>>> The vote for the RFC #[\Deprecated] attribute is now open: >>>> >>>> https://wiki.php.net/rfc/deprecated_attribute >>>> >>>> Voting will close on Wednesday 5th June, 08:00 GMT. >>>> >>> >>> The #[\Deprecated] attribute has been accepted 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 everyone for voting! >>> >>> >>> Tim will finalize the implementation PR now and work on its merge in th= e >>> upcoming days. >>> >> >> Hi Benjamin, >> >> The vote for the RFC #[\Deprecated] attribute is now open: >>>> >>>> https://wiki.php.net/rfc/deprecated_attribute >>>> >>>> Voting will close on Wednesday 5th June, 08:00 GMT. >>>> >>> >>> The #[\Deprecated] attribute has been accepted 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 everyone for voting! >>> >>> >>> Tim will finalize the implementation PR now and work on its merge in th= e >>> upcoming days. >>> >> >> Since the vote passed, we're discussing how we might use the attribute i= n >> Symfony. >> 2 things on the topic: >> >> 1/ We're wondering about using it at the class level despite the missing >> Attribute::TARGET_CLASS. ReflectionAttribute does allow reading >> attributes without checking these flags and we might leverage this >> capability to make our DebugClassLoader able to inspect those at the cla= ss >> level. >> >> Would you consider adding Attribute::TARGET_CLASS in 8.4 already? It >> would just make sense to me. We don't need the engine to do anything abo= ut >> deprecated classes ever since all we need in userland is a class-loader >> that checks for the attribute. Keeping the engine simpler and empowering >> userland with maximum flexiblity FTW. I'm up for a quick RFC if the >> consensus is this needs one. >> >> 2/ About the "since" parameter, we're going to standardize around 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 >> because I think this would be a very useful practice that'd allow buildi= ng >> nice reporting tools. >> >> > Personally, I'd prefer the "since" format to mimic the notation that > Composer uses on the CLI when specifying a package with a constraint: > "symfony/yaml:7.2.0". This can be parsed easily, and won't suffer from > having arbitrary spacing and version naming prefixes. > > (Still would prefer a "scheduledRemoval" field, as knowing when it was > deprecated is far less interesting than 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 during minor releases? Knowing what > version it will be removed in makes it far easier to understand what will > happen when I upgrade next.) > > > If you're marking a piece of code in a project as deprecated, why does > the deprecation notice need to re-specify the package the code is in? > Wouldn't a regular version string be sufficient? > Because the consumer of the code might not know what package supplied it, particularly if multiple packages share a namespace. > > --0000000000008fb214061bacbecd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jun 24, 2024, 7:35=E2=80=AFPM Stephen Reay <= ;php-lists@koalephant.com&g= t; wrote:

= Sent from my iPhone

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

=EF=BB=BF

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


Le=C2=A0mer. 5 juin = 2024 =C3=A0=C2=A010:18, Benjamin Au=C3=9Fenhofer <kontakt@beberlei.de> a =C3=A9crit=C2=A0:


The vote for the RFC #[\Deprecated] attribute=C2=A0is now open:
https://wiki.php.net/rfc/deprecated_attribute
<= br>Voting will close on Wednesday 5th June, 08:00 GMT.

The #[\Deprecated] attribute has been accepted with 23 (Yes) to 6 (N= o) votes, 79%.


The secondary 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 f= inalize the implementation PR now and work on its merge in the upcoming day= s.


Hi Benjamin,

The vote for the RFC #[\Deprecated] attribute=C2=A0is now ope= n:

https://wiki.php.net/rfc/deprecated_attribut= e

Voting will close on Wednesday 5th June, 08:00 GMT.
<= /blockquote>

The #[\Deprecated] attribute has been accepted with 23 (Ye= s) 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 everyone for= voting!


= Tim will finalize the implementation PR now and work on its merge in the up= coming days.


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

1/ We're wo= ndering about using it at the class level despite the missing <= span>Attribute::TARGET_CLASS.=C2=A0= 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.
=
Would you consider ad= ding 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=C2=A0 the "since" parameter, we're going= to standardize around a package+version string, e.g.<= /div>
#[Deprecated(since: "symfony/yaml v7.2&quo= t;]

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 p= refer the "since" format to mimic the notation that Composer uses= on the CLI when specifying a package with a constraint: "symfony/yaml= :7.2.0". This can be parsed easily, and won't suffer from having a= rbitrary spacing and version naming prefixes.=C2=A0

(Still would prefer a "scheduledRemoval" field, as knowing when= it was deprecated is far less interesting than knowing when it will be rem= oved. Yes, I can assume the next major version, but what if it's major = version + 1? What if a project allows removals during minor releases? Knowi= ng what version it will be removed in makes it far easier to understand wha= t will happen when I upgrade next.)

If you're marking a piece of code in =C2=A0= a project as deprecated, why does the deprecation notice need to re-specify= the package the code is in? Wouldn't a regular version string be suffi= cient?
Because the consumer of the code might not know wh= at package supplied it, particularly if multiple packages share a namespace= .=C2=A0


=

--0000000000008fb214061bacbecd--