Re: Allowing NULL for some internal functions

From: Date: Mon, 28 Feb 2022 22:11:36 +0000
Subject: Re: Allowing NULL for some internal functions
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-117170@lists.php.net to get a copy of this message
Am 28.02.2022 um 22:05 schrieb Christoph M. Becker <cmbecker69@gmx.de>: > 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. I'm not sure I get your point here: If you provide a user-land implementation of the previous behavior under a different name then the BC break cannot be serious? - Chris

« previous php.internals (#117170) next »