Skip to content

Commit 8899b14

Browse files
committed
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)`.
1 parent 3a864d7 commit 8899b14

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ function array_product(array $array): int|float {}
18711871

18721872
function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {}
18731873

1874-
function array_filter(array $array, ?callable $callback = null, int $mode = 0): array {}
1874+
function array_filter(array $array, ?callable $callback = null, int $mode = ARRAY_FILTER_USE_KEY): array {}
18751875

18761876
function array_find(array $array, callable $callback): mixed {}
18771877

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)