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

Calling offsetUnset on an ArrayAccessible should reset the count #4287

Closed
BackEndTea opened this issue Dec 29, 2020 · 3 comments
Closed

Calling offsetUnset on an ArrayAccessible should reset the count #4287

BackEndTea opened this issue Dec 29, 2020 · 3 comments
Labels
Milestone

Comments

@BackEndTea
Copy link
Contributor

Bug report

unset() does this already, but offsetUnset does not.

Code snippet that reproduces the problem

https://phpstan.org/r/07c01a9b-f5e8-4f48-8591-105d9d715607

Expected output

I'd expect this snippet to not have any errors

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Dec 29, 2020
@phpstan-bot
Copy link
Contributor

@BackEndTea After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-13: Strict comparison using === between int<1, max> and 0 will always evaluate to false.
+No errors

@ondrejmirtes
Copy link
Member

Fixed by: phpstan/phpstan-src@98fb540

ondrejmirtes added a commit to phpstan/phpstan-src that referenced this issue Apr 2, 2021
@github-actions
Copy link

github-actions bot commented May 4, 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 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants