[go: up one dir, main page]

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

reportPossiblyNonexistentConstantArrayOffset incorrectly erroring on fixed-length array #10997

Closed
simon-tma opened this issue May 13, 2024 · 2 comments

Comments

@simon-tma
Copy link

Bug report

When accessing an array of a fixed size with a counter variable that fits within that size, reportPossiblyNonexistentConstantArrayOffset is generating an error.

The reproduction link shows a test case for it, though doesn't error as I can't enable the config option.

The error it generates is:

Offset int<0, 3> might not exist on array{1, 2, 3, 4}.

Code snippet that reproduces the problem

https://phpstan.org/r/d2e841b0-7150-4e6c-8ffd-173f10583786

Expected output

No error should be reported.

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

I am enjoying the updated Pro UI! The little progress bar down the bottom is amazing, especially if a change requires re-analysing a lot of files.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@5277630

And thanks for the feedback!

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

No branches or pull requests

2 participants