R: [PHP-DEV] [RFC] Deprecate passing null to non-nullable argumentsof internal functions
| From: | Silvio Sparapano | Date: | Wed, 02 Dec 2020 16:34:03 +0000 |
| Subject: | R: [PHP-DEV] [RFC] Deprecate passing null to non-nullable argumentsof internal functions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112375@lists.php.net to get a copy of this message | ||
Hello,
IMHO it’s only a declaration issue.
In other terms, if documentation of strlen says:
strlen ( string $string ) : int
then I mean that $string MUST be a string, and return value MUST be an int.
But then we found that if $string is null, zero is returned. If $string is an array, null is
returned …
We simply need consistency between how a function is documented, and how it really works.
I mean, it may also be convenient for strlen to accept a parameter type other than string (such as
null), but it must be well documented.
Da: Josh Bruce
Inviato: martedì 1 dicembre 2020 22:21
A: Nikita Popov
Cc: PHP internals
Oggetto: Re: [PHP-DEV] [RFC] Deprecate passing null to non-nullable argumentsof internal functions