Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127486 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 A4D421A00BC for ; Tue, 27 May 2025 19:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748372583; bh=Svk38wxXH3iMHReDopu4z0gwAnMVntWtQ12ln2mUeTY=; h=From:Subject:Date:References:To:In-Reply-To:From; b=G7sh+7Qq/MTjFPOpgDhIRfa+nI4C/TVzSagsnD8vNKK/hwhk5drHj+swhVxbcDRoo GfCgtGixK3JVukrvBX5Y6CkU38aVG+y2td13f3zmN4YV/zRXK1zQJTudlrntr2jcSw KQcG5knELNAwXoUFQIVKhM5o9nMU9DqpdYgWD/1udPA2BZw0vnrng6kxKrneL7hIa0 K9PJ82MuRb7sXnx6yrzIvbiSQOr06wxIPMSub9FHNxv31oDXUqvRaYomGG+/q+rYqB zb1h+jdkiSRN4fGbL0evd3GB59yWyiuFvGsIQW05OZmQrdr+UWOtaJVliiEyx9oCco yrtq2dkh+s/8Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0E45180086 for ; Tue, 27 May 2025 19:03:02 +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=1.7 required=5.0 tests=BAYES_50,DMARC_NONE, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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, 27 May 2025 19:03:02 +0000 (UTC) Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e7da03bb0cdso1698421276.3 for ; Tue, 27 May 2025 12:05:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748372708; x=1748977508; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fUClQxLifATViR5BJM+oIGLOEY0WBH/K09J4uwH2XPw=; b=big9Vp+EbG61HKGrxNessBCFEeRDIlXQpHgFRrcAcWvXqYyyhKFgQUdLDCAI4J0ou+ K603Mc6WDgDVuMquyADpChO2rZuViKjOheZUjYU1bWSBCMA8KbAC0rvUBWDrobmYWm8y EavM3340i8ph1eH0ezoSRpQ+R3+F8ARNXQQDScdb6y0hY6x5UcfB5p5N/Ya9akT74s38 E4tT8UsI8YVALw21JUdHxj+YkMKE10pTuBFdbw8LZjWa2Vl05P8iC7G62kCTJes7IOq7 lxr/xEWjmLGDbvS2dSB3aW+J4aJS0GIMAdDm2owPtLkB3CU68BGsDYSN+cd28taUyitY usyA== X-Gm-Message-State: AOJu0YzH0ab1nd3wqSDRDEi1DnNe/EVYvcDG+4m59qpZng5KsaRUembB 5jSHVTHOU6BOcfebD1+M2N5ndUFYqUoHVRHE2UPkq25yh3k5tqP9GLTayvXu6Ry3K6jWxwsUpBz XPNIx7m1x X-Gm-Gg: ASbGncukXvA1NBAey02rCtpWihcgMCukZHVPsXqWoXzSC+DSKRFHBPqeuNHMyi6D0Kf zc5n7vWqv2yBwWxp8sR6grofI1+Kl9Lq20CWNPaM2/sdjhjs3xGX7i9Qt6T7LFwhiCAAFLLAgu7 IdRFstXyXWa8SqMRTIjRh4cM3rJA5XRjPHjObzuNGRu7weiqpXlybP/WjyMfTRUeCKvZRGgCBOn R+DVlh/k949kpeIDkhYEXF5gZwO+cjmbxY58XIdWhWD1pH0yQZJiLoaGr7+hnEITTS2LsaBizfw pmUqzmbr15W0/9roQurw63kXriQnsktm2VGwGG7AfXbFYYLwG7BMRtvKPWEVrEVsye7TxYZDgKM C7Gj5kOfFpcxgSfeY2LhFvKvLVL3ViqKdYy9k03o= X-Google-Smtp-Source: AGHT+IEiZz+VdssfyvH2r2mtVpEqSYKXgtY5CMQgiky64B/bkI06At3F0keUwwdHSxeSTGm2MzT0rQ== X-Received: by 2002:a05:690c:9a01:b0:70e:29d2:fb96 with SMTP id 00721157ae682-70e2db26445mr163948917b3.36.1748372708562; Tue, 27 May 2025 12:05:08 -0700 (PDT) Received: from smtpclient.apple (h96-61-170-179.lvrgtn.broadband.dynamic.tds.net. [96.61.170.179]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e7e96386bd2sm3525276.24.2025.05.27.12.05.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 May 2025 12:05:08 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_E7076060-553A-43A3-BEB2-F28B1D1EA6A4"; protocol="application/pgp-signature"; micalg=pgp-sha256 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV] #[Deprecated] Attribute Date: Tue, 27 May 2025 14:04:56 -0500 References: To: PHP Internals In-Reply-To: Message-ID: <329A033B-585E-45CD-8171-D0CE8334A8B2@php.net> X-Mailer: Apple Mail (2.3826.600.51.1.1) From: ramsey@php.net (Ben Ramsey) --Apple-Mail=_E7076060-553A-43A3-BEB2-F28B1D1EA6A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 13, 2021, at 06:43, Benjamin Eberlei = wrote: >=20 > On Wed, Jan 13, 2021 at 1:05 PM Brent Roose = wrote: >=20 >> Hi Sara >>=20 >>> On 22 Dec 2020, at 19:54, Sara Golemon wrote: >>>=20 >>> On Tue, Dec 22, 2020 at 12:35 PM Nicolas Grekas < >>> nicolas.grekas+php@gmail.com> wrote: >>>=20 >>>> It would be great to allow adding this attribute on classes. What = about >>>> allowing it right now and not bind it to any runtime side-effect? = That >>>> would allow static analyzers to do their job. Same for consts and >>>> properties by the way. >>>>=20 >>>> Also, it would be very useful to add named parameters to the = attribute, >>>> namely: "package" (the name of the package that declares the = deprecation) >>>> and "version" (the version of that package that introduced the >>>> deprecation), next to the message. >>>>=20 >>>> This is critical info when building reports of deprecations. >>>>=20 >>>>=20 >>> You could do that now with a polyfill from userspace. If the = annotation >>> need not have an effect, then it's just any other userspace = implementation. >>=20 >> The difference is that PHP core has the ability to force = standarization. >> There's already JetBrains' implementation of #[Deprecated], which = Psalm and >> PhpStan also support, but it's not a real standard. Maybe the FIG = would one >> day step in to decide these kinds of things, but the reality is that = many >> major frameworks don't follow FIG as closely as they used to. I think >> there's value in adding attributes in the core, with the goal only = being >> static analysis. It'll allow for consistency and that's a valuable = thing. >>=20 >=20 > I want to keep #[Deprecated] on other elements than functions / = methods out > of this RFC, because they require entirely different implementation > approaches. >=20 > We identified in the PR already that this should at some point be > standardized in core, because internal attributes will currently not = be > able to support extension through inheritance by userland for > implementation reasons. >=20 > My next RFC update will reflect this future scope. Last night, I identified a need for `#[Deprecated]` on a userland class = in one of my libraries, but I had to settle on `@deprecated` for the = widest range of compatibility. Has there been anymore thought on putting together an implementation for = this? I=E2=80=99m happy to draft an RFC if someone is able to help with = the implementation. I don=E2=80=99t understand the complexities around = the implementation, but is this something that could make it into 8.5, = provided an RFC vote passes? Cheers, Ben --Apple-Mail=_E7076060-553A-43A3-BEB2-F28B1D1EA6A4 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----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCaDYM2AAKCRCwLZeYnIwH G7QfAP4ndUScvcRzge0rCtaOam5uBLK80kgWMNKkIaOd8wrHBgD/XBd6hhZ0Yh0D LviZthB6MoPKyhF3WbIDsT/NVqlgEIs= =irTW -----END PGP SIGNATURE----- --Apple-Mail=_E7076060-553A-43A3-BEB2-F28B1D1EA6A4--