Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Sep 16, 2024

a collector should either return a valid result or null - because the returned value is persisted in PHPStan result cache (except for null). therefore you should not return things like [], as this would get serialized per AST node your collector works on.

thats something I learned today and in one of our projects it lead to out-of-memory fatal errors.

for in-detail context see phpstan/phpstan#11701 (comment)

@pb30 pb30 merged commit 9d69b92 into pb30:main Sep 17, 2024
@pb30
Copy link
Owner

pb30 commented Sep 17, 2024

Nice, thanks!

@staabm staabm deleted the patch-1 branch September 17, 2024 15:49
pb30 added a commit that referenced this pull request Sep 18, 2024
This reverts commit 9d69b92, reversing
changes made to 2884ddf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants