-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Bug report
When iterating an array that has both numeric and non-numeric values, PhpStan incorrectly reports Call to function is_numeric() with 1|'a' will always evaluate to false..
Code snippet that reproduces the problem
$apples = [1, 'a'];
foreach($apples as $apple) {
if(is_numeric($apple)) {
echo 'number';
}
}https://phpstan.org/r/25842e1a-5522-49d9-a0a5-a5722c6d8e15
Expected output
I expected no errors here, but PhpStan reports:
+--------------------------------------------------------------------------------+
| Line | test.php |
+--------------------------------------------------------------------------------+
| 6 | Call to function is_numeric() with 1|'a' will always evaluate to false. |
+--------------------------------------------------------------------------------+
Reactions are currently unavailable