Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126712 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 03D3A1A00BC for ; Tue, 11 Mar 2025 09:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741683920; bh=erSGEZaMrIwJDmjq6ex7mDdNcTXaM6iIIgH9dc+I+3s=; h=From:Subject:Date:References:To:In-Reply-To:From; b=V3GSirnWfCRI71eAhCZtuFWfz4WyoVKXhkqc+Yx9N0qPhUDqKz1twzVR0y4KwaZzz EtZbvjNGPeNGHx6ebNGnEuhJrmPJubZV6wWB/x0IXCBmm2aAJekXVRkRm8R8mHS7AV AKZBEnvp2oaQQodYwTzmlWj3LlA4Sy4wWg1ba7SWqSQyw8XJ+e9ZnkX2s+0kkQIk/v MT8jjT14L4Yd6g7klvbxbga/kma+l5IkXwSefG0D5KZPRMimWBu9e3RgWAf0KFyFg6 qSKEE1QB/l04Rden7i/v0xDUkhF3FJM1yciJOGmUhPwCRV5VPzqC3MQ8ijW5749QdJ d4fZz53BQaeJw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5740D180032 for ; Tue, 11 Mar 2025 09:05:19 +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.1 required=5.0 tests=BAYES_00,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 mail.gna.ch (mail.gna.ch [212.45.196.109]) (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 09:05:18 +0000 (UTC) Received: from smtpclient.apple (unknown [IPv6:2a02:1210:2e2d:4d00:fd5a:4e01:516f:5509]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 5140F3A0795 for ; Tue, 11 Mar 2025 10:07:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1741684071; bh=erSGEZaMrIwJDmjq6ex7mDdNcTXaM6iIIgH9dc+I+3s=; h=From:Subject:Date:References:To:In-Reply-To; b=KH6jZXlx0FwDvwl1MYshPVfNXaH0MqDyhHjXk9j777dIdG3/lAE3QLkCX8vMducpJ dmJwqZvxL9KWOZtuziMtyiCQ8c/jJWy31eVVQ956ti5sF9KzAdgacp+yuglTT12Vqb ps+wDwO7moKOsXIITp39RVtF99+s+2uGqn4cqUzU= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: [PHP-DEV] Consensus on argument validation for built-in functions Date: Tue, 11 Mar 2025 10:07:50 +0100 References: To: PHP internals In-Reply-To: Message-ID: X-Mailer: Apple Mail (2.3826.400.131.1.6) From: cschneid@cschneid.com (Christian Schneider) Am 11.03.2025 um 07:32 schrieb Gina P. Banyard : > On Monday, 10 March 2025 at 23:07, Jorg Sowa = wrote: >> I=E2=80=99d like to align on the approach to validating arguments for = built-in functions (usually for flag inputs). Some ongoing discussions = in PRs: >> - https://github.com/php/php-src/pull/15647 >=20 > My opinion on this topic is well known, validation errors should go = straight to a ValueError. > And if not a ValueError then it should be an E_WARNING. > Raising a deprecation is frankly non-sensical. I'll sound a bit like a broken record :-) The very first example shows why we should have an E_WARNING phase to = smoothen BC changes: Code like $a =3D array_filter(["a", "", "b"], strlen(...), 666); which currently ignores the bogus value and allows the code to continue = would suddenly stop with en Exception. Fixing the code is trivial and a warning helps identify those code = locations but decoupling the moment of upgrading PHP from having to fix = all code is IMHO still valuable. Especially when using third-party = packages which might have a delay in fixing it. I'm still waiting on some packages to fix new warnings for PHP 8.4 even = though we've upgraded to the new version already. Conclusion: Yes, I'd very much like the 1) warning 2) ValueError approach from the = original mail to be the default. Regards, - Chris