We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
reportPossiblyNonexistentGeneralArrayOffset fails after using php function to get the last key in a non empty array.
Offset (int|string) might not exist on non-empty-array<string>. offsetAccess.notFound
https://phpstan.org/r/b29ae8a5-c605-4130-9417-8e46c2d64312
I would not expect reportPossiblyNonexistentGeneralArrayOffset to fail on the example provided but it does. Same for a count -1 type setup.
(the playgroud doesn't fail but I can't seem to turn on reportPossiblyNonexistentGeneralArrayOffset)
PHPStan makes me happy every workday and has saved me an approximate infinity reviewing things static analysis could have told me. Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report
reportPossiblyNonexistentGeneralArrayOffset fails after using php function to get the last key in a non empty array.
Code snippet that reproduces the problem
https://phpstan.org/r/b29ae8a5-c605-4130-9417-8e46c2d64312
Expected output
I would not expect reportPossiblyNonexistentGeneralArrayOffset to fail on the example provided but it does. Same for a count -1 type setup.
(the playgroud doesn't fail but I can't seem to turn on reportPossiblyNonexistentGeneralArrayOffset)
Did PHPStan help you today? Did it make you happy in any way?
PHPStan makes me happy every workday and has saved me an approximate infinity reviewing things static analysis could have told me. Thanks!
The text was updated successfully, but these errors were encountered: