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
The supplied range exceeds the maximum array size #6375
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
Hi, a minimal example would definitely help here. Try deleting code from the file until the error no longer shows. Go one step back - the error now reproduces. Now delete some other code and verify the problem still shows. You'll end up with a minimal example. |
This might fix it: phpstan/phpstan-src@86b9306 Please test phpstan/phpstan dev-master to see if it fixes it. |
@ondrejmirtes It's not fixed. But I had some time for analyzing and I think that the problem is this line https://github.com/phpstan/phpstan-src/blob/1aef99d3c0bf5edb7448622f45376923c7e4aa3c/src/Type/Constant/ConstantArrayTypeBuilder.php#L114 in combination with values like this: |
Fwiw, I am using similar int ranges in phppstan-dba, and did not yet hit this error |
The |
Fixed by: phpstan/phpstan-src@d3f968d |
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. |
Bug report
I see this error message
The supplied range exceeds the maximum array size: start=-2147483648 end=2147483647
after the update to v1.4.0.Code snippet that reproduces the problem
Sadly, I can't find the root cause of the problem because it's a legacy class with ~2000 lines of code and the error message says nothing about why or where. :-/ I tried to delete random methods from the class and at some point it works, but if I only delete one of the methods it will fail again?
Expected output
Non error.
Did PHPStan help you today? Did it make you happy in any way?
Not today, but I already had one of those "make one change in codebase and then fix errors until
phpstan
stops complaining, then run it, and it works first time" moments. :)The text was updated successfully, but these errors were encountered: