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

Oversimplified huge const array #8636

Open
ddebin opened this issue Jan 3, 2023 · 1 comment
Open

Oversimplified huge const array #8636

ddebin opened this issue Jan 3, 2023 · 1 comment
Labels
Milestone

Comments

@ddebin
Copy link

ddebin commented Jan 3, 2023

Bug report

Do you think we can disable the new optimization for huge const arrays?

Don't know if it can be considered a bug but my const is now oversimplified and the array shape is not guessed as precisely as it used to be with PHPStan <1.9.5.

Code snippet that reproduces the problem

https://phpstan.org/r/ba75c9cd-8683-421d-8996-742e72c108ea

Expected output

No error!

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

For sure, it's an amazing and helpful tool. 👏

@VincentLanglet
Copy link
Contributor

Do you think we can disable the new optimization for huge const arrays?

What could be interesting maybe is to provide configuration for constants like

ConstantArrayTypeBuilder::ARRAY_COUNT_LIMIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants