Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126715 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 03DC01A00BC for ; Tue, 11 Mar 2025 11:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741691994; bh=AJOPHdKn2zc0BHrwly4MLdrS04U3I9mZsGMDtz3KYEI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=oBBMF8xfFTtNSkH4K62PRoI73vkKDP3b8Xjx2MqJmecOj99Oe8LGnfE3AKL/g7g92 TStgIS5Nupu+WuCqIEWTl4eLi6h64A0srLbqDA+V4fT7b1Zohb4MXo4az9auK7/cQi sHwGdEm3DiciTN/md9CKfc/tSeJp1eJYfIVLrZohYByymq925fvLLAghtqC7ZvJJeS DEGWFXN4QQ9q44BKOQ8ijRT2PTq0mDK3GwGGzv5nAOi46AaXJguzQtQSvSDzGVz8cq Mf5dLhKi0++T91Iw6VqnkFNTK5vHjltwbgM7R7M4YYZZu6Fjywt/XbZ93n8gyEGtRK RTEveNuFzyM7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 30DA81801DC for ; Tue, 11 Mar 2025 11:19:54 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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, 11 Mar 2025 11:19:53 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 96BBF11401FF for ; Tue, 11 Mar 2025 07:22:27 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Tue, 11 Mar 2025 07:22:27 -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=fm1; t=1741692147; x=1741778547; bh=0AmES+tNycrA7/veaVKxuuLNK3V0bPCyWbfcF8PG7Wo=; b= YG3AH/8DeuO5EaAxLzUkZeScXa1rNB35QIJlwpg9jJeuGW+VOkcM+VByxkefDz5l 3SIen4uvzc32FFRGBNk1CeOmSz1eX1XkeWWmO8cb3WeBVa20ritp6C6BMWLwhW/x S440pGHL42qF2Ldpa8U6HsvoYXylDV5MR1cP9bX/HGSoLkATIf4Ar77MNEcn7rW3 am/OFgPnp5ixmgxDDfdvtLGQvWLGdAGU7XUv5n9hQEiB3durXCAoFOekp0NSfuXN 0e8SdSgLdOkKzZPHZf+ZrPpRkqkmvWMfBCzm9YpIRKvJhllLplaeWCXHU3F3D2Db bXsFLfBTjtQVAsMStNdEvA== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741692147; x=1741778547; bh=0 AmES+tNycrA7/veaVKxuuLNK3V0bPCyWbfcF8PG7Wo=; b=7PDWzFDUCaCZ6Cwfe 238NTZ8Hyo45rNqyrOzzI4nO3kJVOtDO5pfXgfzSW0zOPgLz4NYVS8d0Mteia8I/ RYNbNL+0ApoD6Z3AQbA/uNHIsINqm0RrpXBFpMdd6mVXNlGZqYyeGgw2DjkT2PJK foloVCiN6WcgBeY3aNU220Mys6mioGxypQ0YuJzIXhJTp6WzZhG9yHuEm4heBVu/ mdQ/0zcN09164AYsA+f3EXAyxM/Nv7rGzZD4gKwdzHmuMkfEIqRI6ql3BHxMRmg+ 2RWjqz63hoicT8/jV7bO4hWrx4Sbf4n4SY0pEtxG5d285fgj2njMOV3ltZxllfTS TXGLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvddvuddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpefhleelteekveffgeeileetgffgvdelfeevuefgvdekkefh vdetfedufeeiheehfeenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigv tgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 11 Mar 2025 07:22:26 -0400 (EDT) Message-ID: Date: Tue, 11 Mar 2025 11:22:23 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Consensus on argument validation for built-in functions To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 11/03/2025 06:32, Gina P. Banyard wrote: > And if not a ValueError then it should be an E_WARNING. > Raising a deprecation is frankly non-sensical. > Validation errors exist to inform the person programing that there is > an error with the call site that is preventable very easily. > If we start emitting E_DEPRECATED instead of E_WARNING/throwing a > ValueError, we are incentivising people to add throwing error handlers > for E_DEPRECATED, > something that I (and I know others too) lament constantly, as a > deprecation is not an error. I dedicated a whole section in a previous RFC to making essentially this same argument: https://wiki.php.net/rfc/deprecate-bareword-strings#e_warning_vs_e_deprecated The underlying problem is that "deprecation" isn't really a "severity", it's more a "category" of messages. It should maybe be a separate flag combined with the severity, so that E_DEPRECATION_NOTICE=E_NOTICE|E_DEPRECATED, and E_DEPRECATION_WARNING=E_WARNING|E_DEPRECATED That way we could signal the difference between "this is bad, but the behaviour will remain well-defined" (e.g. file I/O warnings, which would require a completely new API to eliminate) and "this is bad, and there are concrete plans to change it" (e.g. it will become an error, or start doing something different, in the next major version). -- Rowan Tommins [IMSoP]