Re: NULL Coercion Consistency

From: Date: Thu, 14 Apr 2022 08:27:35 +0000
Subject: Re: NULL Coercion Consistency
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-117528@lists.php.net to get a copy of this message
On Thu, 14 Apr 2022 at 08:31, Robert Landers <landers.robert@gmail.com> wrote: > > I see null as a real type > > This confuses me... Andreas is probably the best person to explain their view; oddly I see NULL as it's own type as well, because are there are times where it's useful to determine the difference between NULL and an Empty String; but when looking at examples like user values (e.g. GET/POST/COOKIE) being checked (e.g. strlen() or preg_match()), encoded (e.g. shown on a web page with htmlspecialchars()), or simply modified (e.g. trim()), I don't see why those possible NULL values should lead to a Fatal Type Error (unless you are talking about an environment that uses NULL as an invalid value, but I suspect that's quite rare). I see this RFC as a balance in that regard, because real life is > messy. I really hope it passes and good luck! > Thank you Robert, it's right the balance I'm trying to find. Craig

« previous php.internals (#117528) next »