From 1dcb559664277a2605eae4ca5c82310afa5a6d5f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 9 Apr 2020 15:52:05 +0200 Subject: [PATCH] Mark array_walk $userdata arg as UNKNOWN It makes a difference whether this arg is not passed or is null. --- ext/standard/basic_functions.stub.php | 4 ++-- ext/standard/basic_functions_arginfo.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.50.1