[php-src] Issue #12261: is_no_input
| From: | AlessandroRosa | Date: | Thu, 21 Sep 2023 12:56:37 +0000 |
| Subject: | [php-src] Issue #12261: is_no_input | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245412@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12261
Author: AlessandroRosa
### Description
This function checks whether the input variable actually exists or includes something:
PHP provides a set of functions "is_null", "is_set", "empty" ... that
accomplish different tasks or are ambiguous,
like "empty" returning false when the input variable is set to 0.
No such feature looks like being available yet, to me.
function is_no_input( $input = null )
{
return is_null( $input ) || !isset( $input ) || strlen( trim( "$input" ) ) == 0 ? 1 :
0;
}