Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123838 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 8FEB21A009C for ; Tue, 25 Jun 2024 18:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719340842; bh=/hjZTCgDFPaM6yncVMKm/qGU51S4YHFtxkJmv2RgTnQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IuNyeYNTaD8J+/RMKlJ50ZDSXTIaKiR0kwqmYIMEdyKDY1GNmNDtvQuApC84mylns bQy6umsLbVH55KgU/4wcNPbPJ5k9aTRbR4t9mZ6T/J4TZXdBtBJJww+2Uj3Okrwwnh dhD5pC0VrVwKL+7u+XlVicjhcEQwqseZAskzpqzTQF34e6kTwBtZRpszDV6yQZlsWI BvuGXRFrBS0Eu4xAJ/W3dAOZIWjpBYoMREoHM2+40jEdL12ecBoFiCyTHPHERUwez4 LleoTfyYAz50b0KpLEtlC1HQGay+EC9ofOixl2XetvY4OLri1WAgBCmA3dSWDmLdNN hK4Z9Lxqp6BJQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A63171806AE for ; Tue, 25 Jun 2024 18:40:41 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 18:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1719340762; bh=qlFYFdXzkiyJP123v+Aldf/yLLjXJwxvyTzdUeaKsQo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=i724uGpvcDIHUxBynXXByAz+J0nPVaic51BiLKAUlD4aHl7lMofbGrVOirB+CA1Rv bFErxw5KdEvtvZQJ8hhx5U/6ty/U7XnsX6J5fJpKZKnMX1n87Ccdecrlt4NWgN9YNz 1d9julfdX+UYSlw9cI4dcitodmf4qHpD5pzuj8lMXCtYkXZMIPA3RPGAamWDsZYplg FSUiwiYxyoChco0hp/rTfrUYIseSTWiF0yMg6QRNLtDp+S/Qqyz/tbTpUEMOP6mPDz 1n/If0w023/EMPMZABrN1vpYbXZ9BNTpTYtM6PvNRdW+miY6xT2AVcyZq3zuhA12kn +dRUpdArTT9lA== Message-ID: Date: Tue, 25 Jun 2024 20:39:20 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] Re: [RFC] [Vote] #[\Deprecated] attribute To: Nicolas Grekas , =?UTF-8?Q?Benjamin_Au=C3=9Fenhofer?= Cc: PHP Internals References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 6/24/24 17:06, Nicolas Grekas wrote: > Since the vote passed, we're discussing how we might use the attribute in > 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 class 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 about > 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. I didn't consult with Benjamin and thus I'm not speaking for him, but for me this definitely requires an additional RFC: A main point of our RFC was to make the *existing* deprecation functionality available to userland. There is no existing deprecation functionality for classes (e.g. no ReflectionClass::isDeprecated()) and thus supporting the attribute on classes was out of scope / left for future scope. Personally I would against such an RFC, because it adds to the inconsistency of the language by not emitting a deprecation warning. > 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 building > nice reporting tools. You might be interested in this thread on the implementation PR then: https://github.com/php/php-src/pull/11293#discussion_r1647339607 Best regards Tim Düsterhus