You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Analysis of array passed to array_search takes prohibitively long with huge arrays #8147
After upgrading from PHPStan 1.8.2 to 1.8.8, and the CI pipeline that runs PHPStan started timing out. With --debug I isolated the issue to be in a classes that contain huge array constants. In the newer versions they take prohibitively long to analyse.
@rvanvelzen commented that it's caused by the analysis of the array_search call.
This does not fail yet, but with around 2000 entries in the array it times out (and then I can't shared the link). I've attached a sample with 10k entries that takes 66 seconds to analyse on it's own on my dev machine.
Expected output
I expected the size of the array not affect the analysis time this much, especially when it's type is annotated.
Did PHPStan help you today? Did it make you happy in any way?
It's absolutely amazing and a complete paradigm shift for php.
Activity
ondrejmirtes commentedon Oct 11, 2022
Fixed by phpstan/phpstan-src#1818
github-actions commentedon Nov 12, 2022
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.