Re: Allowing NULL for some internal functions

From: Date: Mon, 28 Feb 2022 21:05:40 +0000
Subject: Re: Allowing NULL for some internal functions
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-117169@lists.php.net to get a copy of this message
On 28.02.2022 at 21:51, Craig Francis wrote: > And after all of this, no-one has come up with a way to find or address > this problem, e.g. > > <?php > $nullable = ($_GET['a'] ?? NULL); > echo htmlentities($nullable); > ?> <?php function my_htmlentities(string|null $value) { return htmlentities($value ?? ""); } $nullable = ($_GET['a'] ?? NULL); echo my_htmlentities($nullable); ?> The BC break doesn't appear to be that serious after all. -- Christoph M. Becker

« previous php.internals (#117169) next »