Incorrect type inference for return type of array_sum()
with constant types
#9808
Labels
Milestone
array_sum()
with constant types
#9808
Bug report
When the type
list<1>
passed toarray_sum()
, PHPStan reports the return type is1
, which is not always true.Code snippet that reproduces the problem
https://phpstan.org/r/2d45917d-fb24-4ecb-8c93-ad279fdd7318
Expected output
Dumped type of
$total
should beint<1, max>
Did PHPStan help you today? Did it make you happy in any way?
Yes :)
The text was updated successfully, but these errors were encountered: