Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123206 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 C9C681A009C for ; Thu, 25 Apr 2024 06:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714027496; bh=+TRawYMUsCEATiAvwcRAvICQIHG0SthyMSXvPqiD3Zw=; h=Date:From:To:Subject:In-Reply-To:References:From; b=JSgf7rbxmazpXhvFFKNOvXqFgh37gn4mXOYk2V14JRjNTxb2+4RWiV9ERuYHYIPwA 1hkwFjwj0xv6selJRZVrq5UeESSrWIy6od4pvak45cl+f/EtBhfPUboyxkZkZzmT0Q ZYrpe0yG4Vlvjx+H4O9l/NGsOlHtk2aYSpNrOWnoe4GXjF/QyPo6yI/XutNuE4ZTNR WUzsea9ZPJSdspud3G67AbdAIcrNXj27eLQ47qsAqVZGTvu1nUvMTMuombTNWTAnzj +HDjJg/bu/0iiW+zFWFsMaVRRaXLFkrBqPXrEDjsZlxQamnHao3flB09JpAUgc9TeX 1MzIMTALvsUwQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2D797180004 for ; Thu, 25 Apr 2024 06:44:55 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com [103.168.172.159]) (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 ; Thu, 25 Apr 2024 06:44:54 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 12ED511400F9 for ; Thu, 25 Apr 2024 02:44:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 25 Apr 2024 02:44:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1714027453; x=1714113853; bh=+TRawYMUsCEATiAvwcRAvICQIHG0SthyMSXvPqiD3Zw=; b= MWXdsi6bOPFJilPr7xFro8xmyIxSVC/QRnYmmh58o8xFcYDvlg8O1q8gs6rdD284 rRpLfyyXIzActjH1ckNJsSu68eFBLSaufBM4gsfOBHGE+mEBGJMwmYBZVOlOkOsB bLxxaNWnlpCavldNdIgp7kDBX+JekoTh8hHN2SCRzfbLT1FpkOCiEw5KOhhbTgKh FW5eO9FIpZIAhsW47x9Yz5wZqDjl7ZkbmlizQGJqptSssPsuTx/RuXyWzY9mANd1 BRZDDIUetYSExXWrPEeFhCYlYlxf3yRBO+xiR0mcKOoiGfEMAJoRJ6tRpj2OSO5R nTTOjWV1CUhy1rjB/IZ1Vw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714027453; x= 1714113853; bh=+TRawYMUsCEATiAvwcRAvICQIHG0SthyMSXvPqiD3Zw=; b=U N3VOCyQ55NR1vO5y9w7Oz8C5cxPTD18hyf6h6wFCPDAVYT0lNeNKF8nOCnWrLKWB GsvN4SuCJE3jZU7ysbF5VL6srDv0nrWPTr69EN0rzUA7+t8BcbkpR8YftYoD5TWi BNtNhNdH+nVZe6ZcUwZUp8wpiGqHThd7JUECqI2bIgpgQqmpC/RHKOf7bO+sTADf u2TXHqwJq3A61fwwpaWq27E+y3pjqlk8f+2VJoMRZ/xiKPOcPZIgJNCm7azKEwYO /KABvm/XqQ5zJYGssgqtmQhuSFsNtW9wgMy1j0maJDaeKqxIQSrQPqu+14sq8vGX S0KP5QPMBE0YYijYcpeZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeliedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesth hqmhdttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgn fdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnh epfeetgeejuddtjeeuleeggfefgfekveffkeeffefffeeihffhvdevveejueeiveelnecu ffhomhgrihhnpehgihhthhhusgdrtghomhdpohhpvghnjhgukhdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhp sehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 25 Apr 2024 02:44:12 -0400 (EDT) Date: Thu, 25 Apr 2024 07:44:10 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\Deprecated] attribute again v1.3 User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <5814C522-CD23-4194-A344-1B57CC0A2511@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 24 April 2024 18:18:28 BST, Jorg Sowa wrote: > What about setting this parameter vaguely as the boolean we can pass? > =2E=2E=2E > #[Deprecated(since: $packageVersion > 5=2E5)] > #[Deprecated(since: PHP_VERSION_ID > 80100)] > #[Deprecated(since: date("Y-m-d") > "2024-01-21")] Even if these expressions were legal, as far as I know, standard reflectio= n doesn't give any access to the source code or AST of how the attribute wa= s written, so this would just end up with a meaningless "$since =3D true", = and some source code that might as well be a comment=2E=20 To be honest, I'm not really sure what I'd do with the information in a "s= ince" field even if it was there=2E If you were running PHP 7=2E4, what dif= ference would it make to know that create_function was deprecated in 7=2E2,= rather than in 7=2E1 or 7=2E3? The two relevant facts are when the suggest= ed replacement was introduced (in case you need to support multiple version= s); and what is the soonest that the deprecated feature will be removed=2E = The second in particular is something I would like every deprecation messag= e to include, rather than the vague "may be removed in a future version"=2E I found this discussion of "since" in Rust's implementation, but don't fin= d the arguments in favour particularly compelling: https://github=2Ecom/rus= t-lang/rfcs/pull/1270#issuecomment-138043714 Of interest, that discussion also linked to a related feature in Java, whi= ch could perhaps be added to a list in the RFC alongside the Rust and JetBr= ains ones already mentioned: https://openjdk=2Eorg/jeps/277 It's interesting to note, for instance, that both Java and Rust designers = considered a specific "replacement" field, but decided that it was unlikely= to be useful in practice=2E The Java proposal states this nicely:=20 > In practice, there is never a drop-in replacement API for > any deprecated API; there are always tradeoffs and > design considerations, or choices to be made among > several possible replacements=2E All of these topics require > discussion and are thus better suited for textual > documentation=2E The JetBrains attribute *does* include a "replacement" argument, but it's = heavily tied into a specific use case: it contains a template used for code= transformation in the IDE=2E Both it and "since" are explicitly marked "ap= plicable only for PhpStorm stubs"=2E Regards, Rowan Tommins [IMSoP]