Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117206 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79750 invoked from network); 2 Mar 2022 12:56:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Mar 2022 12:56:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6CE8918054F for ; Wed, 2 Mar 2022 06:17:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 ; Wed, 2 Mar 2022 06:17:29 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1424E32009BB for ; Wed, 2 Mar 2022 09:17:27 -0500 (EST) Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Wed, 02 Mar 2022 09:17:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=vWipGlsVReP4kE6a+ yltvpZbWnCuTCBolxycyJcqKZ0=; b=NDjG20hGxRMavF9mqjKKKASdT3Zt90XEQ DRPXJlOqOPlDDU2D+iBhLkcbMkmBD74N1nepFTHiHNLzVUi9cEw0/WvHje7EGAz5 POxObIf+hs5ncbyfjpfy7CVsBxD72RlX2x2HOwZzkSucH0nuP5Wsf/wZZynuCnnV ZkgyyTp398AuPIYZ8Bix/4QdEvj8K0hUr2W6FyLb1O7/tl1iyyOT+gPiM/DH0u8F 8hBpScV7oql4ctNIWCvmbFA2PLH+TKHp7RgUcEuq3OcinO1B2MnqV6Z9C0/BIeS2 bsHWZjUZKG5A1DJidGwkaAXJbsPvTXn4UfnrYnbW7qeq85BVnt6WQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddtgedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 580B8AC0E99; Wed, 2 Mar 2022 09:17:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4778-g14fba9972e-fm-20220217.001-g14fba997 Mime-Version: 1.0 Message-ID: <2d06bc12-7d7e-4a88-b823-de64642381e6@www.fastmail.com> In-Reply-To: References: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> <5494eaa7-2fa6-8364-9683-a2c8c9789d81@gmail.com> <69642616-72b7-44fe-97a7-27ae03bc8fce@www.fastmail.com> <7fbed755-42e2-d023-285f-39863a97f297@gmx.de> <3665C848-B4C3-4528-AEFA-02C868748AA8@cschneid.com> <0b5bc29d-3814-0e1d-b94a-47790019c778@gmx.de> <4bff3f23-a3ec-4416-f44e-1f4f5d7e0caa@gmail.com> Date: Wed, 02 Mar 2022 08:17:04 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: larry@garfieldtech.com ("Larry Garfield") On Wed, Mar 2, 2022, at 8:00 AM, Craig Francis wrote: > On Wed, 2 Mar 2022 at 12:26, Dik Takken wrote: > >> So, to get this crystal clear, this is my understanding of what you are >> proposing for passing null to a non-nullable function parameter >> (hopefully my ASCII art will come through ok): >> >> >> which | strict_types | PHP 8.0 | PHP 8.1 | PHP 9 >> ----------|---------------|------------|------------|---------- >> user | 1 | TypeError | TypeError | TypeError >> internal | 1 | TypeError | TypeError | TypeError >> user | 0 | TypeError | TypeError | coerced >> internal | 0 | coerced | Deprecated | coerced >> >> Is this correct? >> > > > Yes, that's correct... although I'd be doing this for 8.2, to avoid > TypeError exceptions being introduced for non `strict_types` scripts in 9.0. > > This is based on the feedback from the quiz and here; so type coercion from > NULL would continue to work, like coercion from the other variable types > (string/int/float/bool). > > Craig Null is not an empty string. Null is not a string. Null is not 0. Null is not an integer. The clear trend of the language is toward more type strictness. Going back on that is a bad idea. Furthermore, increasing the delta between weak and strict mode only serves to bifurcate the language and add one more thing that people have to think about when they move from one file to another; the language behaves differently depending on what file you're in. That's already a cognitive overhead. Don't add to it. I am firmly -1 on weakening the type system, even if "weak mode". --Larry Garfield