From 3a864d7509b6286af663099fb8d162253c5a036e Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 31 Jan 2026 20:11:23 +0700 Subject: [PATCH 1/2] ext/standard: add `ARRAY_FILTER_USE_VALUE` to `UPGRADING` --- UPGRADING | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UPGRADING b/UPGRADING index fec4b15c102bd..830709b2ae23f 100644 --- a/UPGRADING +++ b/UPGRADING @@ -142,6 +142,9 @@ PHP 8.6 UPGRADE NOTES . EAI_INTR. . EAI_IDN_ENCODE. +- Standard + . ARRAY_FILTER_USE_KEY. + ======================================== 11. Changes to INI File Handling ======================================== From 8899b14dbdd4ce6a82ec982359a7bfe7037797d9 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 31 Jan 2026 20:11:40 +0700 Subject: [PATCH 2/2] ext/standard: update `array_filter` `$mode` param default value to `ARRAY_FILTER_USE_VALUE` In GH-15647, the `array_filter` function was changed to throw a `ValueError` exception when the `$mode` parameter receives an invalid. Additionally, it declares a new `ARRAY_FILTER_USE_VALUE`, assigned (`int 1`) to it. This changes the default value of the `array_filter` function's `$mode` parameter to use the new constant, changing it from `int $mode = 0` to `int $mode = ARRAY_FILTER_USE_KEY)`. --- ext/standard/basic_functions.stub.php | 2 +- ext/standard/basic_functions_arginfo.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 4ad26063a6718..4f77cf9b7f8ef 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1871,7 +1871,7 @@ function array_product(array $array): int|float {} function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {} -function array_filter(array $array, ?callable $callback = null, int $mode = 0): array {} +function array_filter(array $array, ?callable $callback = null, int $mode = ARRAY_FILTER_USE_KEY): array {} function array_find(array $array, callable $callback): mixed {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 2a1aa634fcdac..d63ea5e4e488b 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: a4324854949e2df355625c18a4e26d066c8f7a17 */ + * Stub hash: 9857f77dbcc832992bf6b20b02d4b81dad8909b2 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -345,7 +345,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "ARRAY_FILTER_USE_KEY") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_find, 0, 2, IS_MIXED, 0)