Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116559 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7818 invoked from network); 2 Dec 2021 16:15:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Dec 2021 16:15:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1F001804BC for ; Thu, 2 Dec 2021 09:14:47 -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=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS1836 195.49.0.0/17 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (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 ; Thu, 2 Dec 2021 09:14:47 -0800 (PST) Received: from smtpclient.apple (unknown [IPv6:2a02:1210:2ea4:cf00:c990:e9d0:430a:8137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 1AE061517D7B for ; Thu, 2 Dec 2021 18:14:45 +0100 (CET) Content-Type: multipart/alternative; boundary="Apple-Mail=_6A8A304B-E32D-44D0-AD31-07B14CA994FB" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Date: Thu, 2 Dec 2021 18:14:44 +0100 References: To: PHP internals In-Reply-To: Message-ID: <4694F956-82CD-4446-B372-8CB9CE380952@cschneid.com> X-Mailer: Apple Mail (2.3693.20.0.1.32) Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: cschneid@cschneid.com (Christian Schneider) --Apple-Mail=_6A8A304B-E32D-44D0-AD31-07B14CA994FB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 02.12.2021 um 16:19 schrieb Sara Golemon : > I would say that such applications should consider unifying their own > types. $a =3D $_GET['q'] ?? ''; Is there a place in the application = where > empty string and null would have been distinct? i.e. Is a search for > nothing different from not searching? Being able to detect if a parameter was present and empty or it it was = not present at all can be useful. That is the whole point of null, even = though some people dislike null :-) In fact we ran into the same problem and are silencing certain notices, = warnings and deprecations because they get in the way of our code base. = (Side-note: We are patching it instead of suppressing it in an error = handler as we saw a noticeable performance difference.) For the curious, here is our patch: perl -0777 -i.bak -pe = 's#zend_error.*E_(NOTICE|WARNING|DEPRECATED).*(\n.*)?(Undefined|Attempt = to read property|Uninitialized string offset|Trying to access array = offset on value of type|Passing null to parameter)#if (0) $&#g; = s#zend_type_error.*must be of type Countable#if(0) $&#g' Zend/*.[ch] = ext/spl/*.[ch] ext/opcache/jit/*.[ch] I am *not* advocating that other people should do this, I'm just = corroborating ;-) Regards, - Chris --Apple-Mail=_6A8A304B-E32D-44D0-AD31-07B14CA994FB--