Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112866 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72303 invoked from network); 13 Jan 2021 12:26:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jan 2021 12:26:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9494E180504 for ; Wed, 13 Jan 2021 04:05:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from srv015.mail.ichtushosting.com (srv015.mail.ichtushosting.com [159.69.182.195]) (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 ; Wed, 13 Jan 2021 04:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stitcher.io ; s=default; h=Message-Id:In-Reply-To:To:References:Date:Subject:Mime-Version :Content-Transfer-Encoding:Content-Type:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7J8Jg4KMNcboGaO0jZZg3qhm8Q7wciFiTPdEqQ/pxaQ=; b=QShY5F0UVm3tzDL0y411cyct7V ryBIqpghBqXK10hFFEF24pgpBZui2Et88EUgRZqMB+xMu3r1VNy/z6MjXJvTcm8fj+Gz/EPcu4a3F 2erRDVuU4CXjoBGrC9NnszOKmFJTM/dthZbDAmVFAXWDRji/xwKzMC2tTXugwjrawNCovShYldncV g8SGx59Boa4jyVmX0HtflLQSM0PMTsOiYY/i/nbW+nHVzzZqJgx/lVr0Zil3P/YZf1WBINfkX2DeD Bxg0YSEyCgsZXg0NpgkV9nSktWUjAgbo454TzRpHgSLTQhI3P5eI3qK/yxYTtTfVZVGM/WeVrhSlZ FajeUecg==; Received: from srv021.web.ichtushosting.com ([78.47.76.72]) by srv015.mail.ichtushosting.com stage1 with esmtp (Exim MailCleaner) id 1kzetc-0002ZC-2e for from ; Wed, 13 Jan 2021 13:05:04 +0100 Received: from ptr-fq9pjph3m78l9h5evrc.18120a2.ip6.access.telenet.be (ptr-fq9pjph3m78l9h5evrc.18120a2.ip6.access.telenet.be [IPv6:2a02:1812:c3c:3a00:4417:61eb:f2e6:7148]) (Authenticated sender: brendt@stitcher.io) by srv021.web.ichtushosting.com (Postfix) with ESMTPSA id 5687620F8D for ; Wed, 13 Jan 2021 13:05:02 +0100 (CET) X-MailCleaner-return_path: brendt@stitcher.io X-MailCleaner-sender_address: brendt@stitcher.io X-MailCleaner-recipients: internals@lists.php.net Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Wed, 13 Jan 2021 13:05:01 +0100 References: To: PHP Internals In-Reply-To: Message-ID: X-Mailer: Apple Mail (2.3608.120.23.2.4) X-MailCleaner-TrustedIPs: Ok Subject: Re: [PHP-DEV] #[Deprecated] Attribute From: brendt@stitcher.io (Brent Roose) Hi Sara > 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. 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 > -Sara Kind regards Brent=