From: Nikita Popov Date: Thu, 9 Apr 2020 13:52:05 +0000 (+0200) Subject: Mark array_walk $userdata arg as UNKNOWN X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dcb559664277a2605eae4ca5c82310afa5a6d5f;p=php Mark array_walk $userdata arg as UNKNOWN It makes a difference whether this arg is not passed or is null. --- diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index d0a3109a7f..bde3924c5f 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -120,9 +120,9 @@ function min($arg, ...$args) {} /** @return mixed */ function max($arg, ...$args) {} -function array_walk(array|object &$input, callable $funcname, $userdata = null): bool {} +function array_walk(array|object &$input, callable $funcname, $userdata = UNKNOWN): bool {} -function array_walk_recursive(array|object &$input, callable $funcname, $userdata = null): bool {} +function array_walk_recursive(array|object &$input, callable $funcname, $userdata = UNKNOWN): bool {} function in_array($needle, array $haystack, bool $strict = false): bool {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 575a998b68..4ecc09fe43 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -140,7 +140,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_MASK(1, input, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_ARG_TYPE_INFO(0, funcname, IS_CALLABLE, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, userdata, "null") + ZEND_ARG_INFO(0, userdata) ZEND_END_ARG_INFO() #define arginfo_array_walk_recursive arginfo_array_walk