-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#2338Description
Bug report
Starting with version 1.10.12, the following code snippet creates a fatal error:
function filter(mixed $data): array
{
return filter_var_array(
$data,
[
'id' => [
'filter' => FILTER_VALIDATE_INT,
'flags' => FILTER_REQUIRE_SCALAR,
],
],
true,
);
}https://phpstan.org/r/432b5663-9303-4742-969b-f4ac0a168e68
Using version 1.10.11 (or lower), or using array type for the $data argument fixes the fatal error:
function filter(array $data): array
{
return filter_var_array(
$data,
[
'id' => [
'filter' => FILTER_VALIDATE_INT,
'flags' => FILTER_REQUIRE_SCALAR,
],
],
true,
);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels