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

While-true: Specific type is forgotten #10980

Closed
greew opened this issue May 9, 2024 · 1 comment · Fixed by phpstan/phpstan-src#3057
Closed

While-true: Specific type is forgotten #10980

greew opened this issue May 9, 2024 · 1 comment · Fixed by phpstan/phpstan-src#3057
Labels
Milestone

Comments

@greew
Copy link

greew commented May 9, 2024

Bug report

When ensuring that a variable $user is of a specific type, when I break the loop, PHPStan afterwards forgets this type and reverts to the original result from the method call a().

Code snippet that reproduces the problem

https://phpstan.org/r/e75b4a5f-6dad-48f9-9f39-1e427351a002

Expected output

No errors

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

Still one of the best development tools, I've got!!! ❤️

@greew
Copy link
Author

greew commented May 9, 2024

It looks a lot like #10245 - maybe the same issue, but can't be sure.

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

Successfully merging a pull request may close this issue.

2 participants