Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infer types based on non-strict equality with constant types #10481

Open
staabm opened this issue Jan 25, 2024 · 0 comments · May be fixed by phpstan/phpstan-src#2889
Open

infer types based on non-strict equality with constant types #10481

staabm opened this issue Jan 25, 2024 · 0 comments · May be fixed by phpstan/phpstan-src#2889

Comments

@staabm
Copy link
Contributor

staabm commented Jan 25, 2024

Feature request

IMO phpstan should narrow types of non-strict comparisions, in case the comparison is done against a constant value, which cannot change meaning when interpreted in a loose-comparison

https://phpstan.org/r/297bee27-5cf8-49ff-9a71-08a73c0aef8b
should not report type assertion errors

Did PHPStan help you today? Did it make you happy in any way?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants