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

Incorrect XMLReader logic implementation: a reader can be reopened, and ->read() doesn't return false after it #5920

Closed
fluffycondor opened this issue Nov 3, 2021 · 3 comments · Fixed by phpstan/phpstan-src#1555
Labels
Milestone

Comments

@fluffycondor
Copy link
Contributor

Bug report

phpstan 1.0.1

PHPStan thinks (\XMLReader) $reader->read() becomes forever false after calling $reader->close(), but it's not true.

Code snippet that reproduces the problem

https://phpstan.org/r/a2f98248-04b5-448e-901e-f89a37dc4d1f

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

Thanks for the new shiny major PHPStan update! ❤️
I've fixed a bunch of errors in my project thanks to this update.

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Nov 3, 2021
@phpstan-bot
Copy link
Contributor

@fluffycondor After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:

@@ @@
-8: While loop condition is always false.
+No errors

@ondrejmirtes
Copy link
Member

/cc @staabm regression test here please :) Thank you.

staabm added a commit to staabm/phpstan-src that referenced this issue Jul 26, 2022
ondrejmirtes pushed a commit to phpstan/phpstan-src that referenced this issue Jul 26, 2022
@github-actions
Copy link

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 Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants