Skip to content

MemoizingReflectionProvider->hasClass() is case-insensitive#4750

Merged
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
staabm:mem-lower
Jan 13, 2026
Merged

MemoizingReflectionProvider->hasClass() is case-insensitive#4750
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
staabm:mem-lower

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Jan 13, 2026

since MemoizingReflectionProvider->getClass() and MemoizingReflectionProvider->getClassName() work on a lowercased string, I think MemoizingReflectionProvider->hasClass() should work the same way to provide consistent results

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented Jan 13, 2026

the out-of-memory errors are unrelated to this change.

I had a look into it, and it seems most of the memory regression we currently see on 2.1.x is related to a increase in resultCache.php size

grafik

the biggest part of the cache might not even be related to phpstan-src itself: shipmonk-rnd/dead-code-detector#287 (removing dead-code-detector shrinks the resultCache.php by ~65%)

https://blackfire.io/profiles/90337c83-aba6-4c80-853d-547f0ac566f2/graph

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented Jan 13, 2026

the above comment only holds for the main process alone.

running with --debug and therefore without workers the memory profile looks like:

grafik

https://blackfire.io/profiles/25009815-b33e-41f1-87d0-3cd594971d8e/graph

@ondrejmirtes ondrejmirtes merged commit 752bed7 into phpstan:2.1.x Jan 13, 2026
618 of 645 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the mem-lower branch January 13, 2026 08:15
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