Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117502 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77900 invoked from network); 8 Apr 2022 16:24:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Apr 2022 16:24:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3369E1804E3 for ; Fri, 8 Apr 2022 10:55:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_05,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8412 83.65.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mail02.x-net.at (mail02.x-net.at [83.65.141.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 Apr 2022 10:55:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail02.x-net.at (Postfix) with ESMTP id 6B6BB38046A; Fri, 8 Apr 2022 19:54:59 +0200 (CEST) Received: from mail02.x-net.at ([127.0.0.1]) by localhost (mail02.x-net.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id d7wGaCSZB5oV; Fri, 8 Apr 2022 19:54:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail02.x-net.at (Postfix) with ESMTP id D27B8380504; Fri, 8 Apr 2022 19:54:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at x-t.at Received: from mail02.x-net.at ([127.0.0.1]) by localhost (mail02.x-net.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Dwj8HoqW1yDz; Fri, 8 Apr 2022 19:54:56 +0200 (CEST) Received: from [127.0.0.1] (193-80-185-206.adsl.highway.telekom.at [193.80.185.206]) by mail02.x-net.at (Postfix) with ESMTPSA id 9B88638046A; Fri, 8 Apr 2022 19:54:56 +0200 (CEST) Date: Fri, 08 Apr 2022 19:54:59 +0200 To: Craig Francis , PHP internals User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] NULL Coercion Consistency From: mel@dafert.at (Mel Dafert) On 8 April 2022 19:34:52 CEST, Craig Francis = wrote: >Hi, > >I've written a new draft RFC to address the NULL coercion problems: > >https://wiki=2Ephp=2Enet/rfc/null_coercion_consistency > >This is due to the result of the Allow NULL quiz: > >https://quiz=2Ecraigfrancis=2Eco=2Euk/ > >14 votes for Fatal Type Errors irrespective of `strict_types=3D1`; >13 votes for NULL coercion when not using `strict_types=3D1`; >8 votes to update some parameters to allow NULL; > >I appreciate some want to force strict type checking on everyone, but I >want to make sure we have this properly documented, with names, and >explanations=2E > >Breaking changes should be justified - if they aren't, they only >make upgrading difficult and frustrating (bad for security)=2E > >Craig Hello, While the RFC extensively documents the problem space, it's rather short o= n what exactly it proposes=2E In particular, does this propose changing user-defined functions under strict_types=3D0 to accept null for scalar types? Eg=2E, this will be allowed (under strict_types=3D0): ``` function x(string $y, int $z) { =2E=2E=2E } x(null, null); //no error, no warning ``` Regards, Mel