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

Not direct condition doesn't change variable type #3986

Closed
snapshotpl opened this issue Oct 22, 2020 · 2 comments
Closed

Not direct condition doesn't change variable type #3986

snapshotpl opened this issue Oct 22, 2020 · 2 comments

Comments

@snapshotpl
Copy link

Bug report

If I check variable type in if statement directly type is infern correct, but when do it early and assign result to variable and check it late, then type is wrong.

Code snippet that reproduces the problem

https://phpstan.org/r/c9d5a01d-59f6-46b9-826c-6159e5a4ece3

Expected output

No error

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@a9d5c8b

@github-actions
Copy link

github-actions bot commented May 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants