Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130225 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 lists.php.net (Postfix) with ESMTPS id 5C3491A00BC for ; Mon, 2 Mar 2026 19:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772481083; bh=EvZY66vdmSC2pX5cymMQyRVqUs2dWzCBNPuW1oRb3gk=; h=From:Subject:Date:References:To:In-Reply-To:From; b=DbloZ76oqISvcy6qTBB+a+xPB9sHuOKD/OO8DfhVyyJ6SYQwgaHx3X+PxLPnNsC3/ qjVw15xDUEYWFcmnthbrb7YVMGGqIUr1p/aMCxXKlZjTUoBO47iXyDsCIimQEjXig3 6PW8KQ3J14XLNA21kcr5XKK75L+xzPx86NzSipQ8mlfGxYyYrsirVY3CRldcTFl7Dr k0EMmYOrq2kKjlX+wWMkWHtL++96o2BZmxQe1ITIQ7v3JdW2uGtW81BHB21XuPoXrW LAqAkkSsjY1X2JNdkdaOWE0wHUhW8ECqvLpUgMMQFFfkYarUQrvf/O80h4IAhYD6ue vRrFQeJ+CYzJQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6A0831805A1 for ; Mon, 2 Mar 2026 19:51:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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_PASS, T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail.gna.ch (darkcity.gna.ch [84.234.28.114]) (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 ; Mon, 2 Mar 2026 19:51:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.gna.ch (Postfix) with ESMTP id 038E92381837 for ; Mon, 2 Mar 2026 20:51:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1772481071; bh=EvZY66vdmSC2pX5cymMQyRVqUs2dWzCBNPuW1oRb3gk=; h=From:Subject:Date:References:To:In-Reply-To; b=XVNzHItzXIL3C4qEUaCVBErbwCS3LcwE0BFPGkalS+VM6wpzrLEpB50swybs98g1K kr4oD/WKAlPY8BHDu+SuOD1DxQuISlmrStqfDLAIb1MzVU/e5sVj9rhBhON0WGjfI/ gXk+AwtDwLEsRo25O2gj7Rag7RZDaSy6dSdxygE4= X-Virus-Scanned: amavisd-new at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (mail.gna.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LvKVnCdzMT25 for ; Mon, 2 Mar 2026 20:51:06 +0100 (CET) Received: from smtpclient.apple (unknown [IPv6:2a02:1210:2e2d:4d00:f1b4:e0a7:9fec:cf1b]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.gna.ch (Postfix) with ESMTPSA id 8EE4C2380A5A for ; Mon, 2 Mar 2026 20:51:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1772481066; bh=EvZY66vdmSC2pX5cymMQyRVqUs2dWzCBNPuW1oRb3gk=; h=From:Subject:Date:References:To:In-Reply-To; b=WgXdvox2TAD0zN3jc6dS7Qq0O+HyNrvoe4csuN6BfuGbO7AEBULfACruRc7aNpDBl DZMVd4np2AZGyOi59jxZZTo3OC5V13MBkjUgMn1zEHqDEGtYJBRuGk1Ed4u5K3BEoE 7dYL5Jk8BEJTI5JLOMP0qp/zHfKRbcazj2yCEtXw= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: [PHP-DEV] [RFC] Exempt input type and value validation from BC Break policy Date: Mon, 2 Mar 2026 20:51:05 +0100 References: To: PHP internals In-Reply-To: Message-ID: <650FCF24-CDBD-4F37-BA50-6D691EE3E3E1@cschneid.com> X-Mailer: Apple Mail (2.3864.400.21) From: cschneid@cschneid.com (Christian Schneider) Am 02.03.2026 um 20:12 schrieb Tim D=C3=BCsterhus : > On 3/2/26 14:49, Christian Schneider wrote: >> Playing my favourite broken record: >> Can we please state that additions of Exceptions should (in most = cases) go through an E_WARNING phase to allow a time window to fix code = before changing the behaviour? >=20 > =E2=80=9CNot passing invalid values=E2=80=9D is perfectly backwards = compatible. Folks can just fix their code before upgrading their = production deployment to the new PHP version, e.g. by trying out the new = PHP version in a staging system or running CI for both the old and new = PHP version. - Not everybody has access to a staging system, e.g. people running = stuff on hosting services. - As a hoster I'd rather have a phase where my customers get warnings = instead of errors, creates less emergency support load. > In practice an E_WARNING is no less breaking than going straight to an = Error, because: > 1. The common frameworks include error handlers that just convert any = warning and notice to an Exception. So in that sense there is also no advantage to NOT having a warning = phase for those people. But people treating E_WARNING different from Exceptions (which is = probably the exact people whose code breaks with an immediate Exception) = do have a time window to fix things. > 2. The code is already broken, because it relies on unspecified = behavior. The error would just making the user aware that the code is = very likely not doing what it appears to be doing based on the input = values passed to a function. It can easily do something valid and ignore the extra bits (pun kind of = intended), see mkdir("foo", 070777); which passes extra bits with are ignored but the application was = behaving in a completely deterministic and valid way. > Going through an E_WARNING would add maintainer busywork and = complicate the php-src codebase for no real gain. We've been over this before: If people *really* feel that the additional burden to change the code = twice then I'd be happy to volunteer providing a small helper = function/macro to generate an E_WARNING and either (the more aggressive = approach) switch to an exception once a certain PHP version is reached = or (probably the more flexible way) issue a compile time warning/error = informing the maintainer to switch the warning to an Exception. The most simplistic version of this is a FIXME comment annotated with a = version number. Easy to grep, easy to trigger automatic alerts about = once the specified version is reached, but it can also be something more = sophisticated.. One way or the other could also be integrated into the CI/CD system. Our main disagreement is about the "no real gain" part as it IMHO = targets the long tail of PHP code / developers out there not using = full-fledged frameworks and dev environments or running legacy software = on hosting services. I am very much in favor of making things easy for the code developers = but I am of the strong believe that it can be done in a good way for = developers. Regards, - Chris