You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered:
claudepache
changed the title
Use of result of impure function in max(...) prevents type narrowing>
Use of result of impure function in max(...) prevents type narrowing
Mar 12, 2025
Bug report
Given an impure function
f()
returning anint
, PHPStan fails to narrow the type ofmax(4, f())
toint<4, max>
(it considers it asint
).Code snippet that reproduces the problem
https://phpstan.org/r/bace30de-7627-425a-9098-9ea3b9b6cf5b
Expected output
Lline 19: Dumped type: int<4, max>
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: