Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124367 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 B5E501A00B7 for ; Wed, 10 Jul 2024 18:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720637151; bh=EI7pvxwH3FPFhMnp8zLiVdXVgRmjXxeXhQzlwHTHMVk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mVWkO/Bes4s7Miwng64pvidVv6ptqf+LOk32nks2jeBcR0UgVs1J/eWeZH2/ORjfF cCF6vPoQztn+tHhRgOZbJ/nvFcKV3hYzGHRVh7Tf/DVSej5ZMYcnOeK8dW+s+S+U/2 WikwAxHIyT5RdF+jY/hLvzVtyQf2dzvC+FBjDpkNVuHd6rmsonjQjzqgBRyVyHyZDf GHPaaVf+na7YJqjY1N1PeO4HW0DFyGOSipvBYqNMQ9l+Orj9eBoWy6cRvjP0tdmly/ 0TX9n6IetCQb9q41umAx9Y4sIifT6lskfqKCVGbYQYXtUoLqpSZwXRnbSVWhmsKs5t 4kPFKJTT3wn7g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 42E48180DC7 for ; Wed, 10 Jul 2024 18:45:49 +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 autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No 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 ; Wed, 10 Jul 2024 18:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1720637059; bh=fPLm+yQPlORMyzg77reEOpgeav50iv2Cx6PGB5Gu5nE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=UWGYLtAoYeURlCikXcqMDxqm5fA8pEEDy5JihvA8awe97/YfGItCzica3YLQC5C3i vDptA8U2uJd4WKnyKf3QUYErAYbm9Q16GHAhFisrML/AO9TYUDMKRXOFyrx7upU2qd tCUKvv6xWi3bHRgNZxWgrkykOCSNOoYaWV8NQ51sOs6GAsOzvmu/8HSBOigbAJA/Jw kyawFDCZsi/RhNkiVRlbFbpu+/aQrsRI3X/JEGtDWuAZST6MCjK7qDhOLaU0hrsbVF sGAQKEYyFiJ+woA5HwU3OPdKYCBLTD1iGYuBnF8QeoddOdoQEA5hZief1j9I9KtrC1 bEC5Xdy89Piig== Message-ID: Date: Wed, 10 Jul 2024 20:44:17 +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 I'm specifically replying to Nicolas, but this email is directed to the general public, so please feel free to reply even if you are not called Nicolas :-) On 6/24/24 17:06, Nicolas Grekas wrote: > 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. > I have merged the follow-up PR to apply the attribute earlier today: https://github.com/php/php-src/commit/29f98e748568ebd66aaae061c0dcefbba92ca058 For now I've filled in the `$since` attribute with a bare version number, since this most closely matches what was described in the RFC. I'm happy to do another follow-up on the format of the `$since` property for internal functions if we can reach a simple consensus here on the list. I think it should also be acceptable to do some basic processing of the `$since` property for the display in the human readable error message, making it easier to consume it programmatically without looking ugly to the human reader. For PHP internal attributes the obvious choice would be: #[\Deprecated(since: 'PHP 8.4')] function foo() { } which would result in an error message similar to: Deprecated: Function foo() is deprecated since PHP 8.4 The space probably is easy enough to understand for programmatic consumption in frameworks / error tracking libraries and the 'PHP' matches how the PHP requirements are defined in composer dependencies (once lowercased). I don't like the 'v' prefix for the version number, because to the best of my knowledge nothing else uses that (except for git tags). You can find the discussion about the `$since` property in the first PR at https://github.com/php/php-src/pull/11293#discussion_r1647339607, if you want additional context. Best regards Tim Düsterhus