Re: Allowing NULL for some internal functions
| From: | Craig Francis | Date: | Tue, 01 Mar 2022 16:28:58 +0000 |
| Subject: | Re: Allowing NULL for some internal functions | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117180@lists.php.net to get a copy of this message | ||
On Tue, 1 Mar 2022 at 13:06, Christian Schneider <cschneid@cschneid.com>
wrote:
> The other way of making internal functions behave like user land functions
> would be to change the definition of the internal function to
> function htmlentities(?string $value) { ... }
> and casting it to string internally which would make the
> definition/documentation/behavior consistent while staying backward
> compatible.
>
True, that is an option, and that's where I started... but I changed my
mind, because developers who use
strict_types=1 can use this extra meta
data (the type check) to verify their code is working as expected.
In other words, someone checking types can see NULL being passed to
functions like escapeshellarg() as an error, and I do not want to break
that for them.
Craig