Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 3, 2026

No description provided.

@ondrejmirtes
Copy link
Member

What's the benefit here?

@staabm
Copy link
Contributor Author

staabm commented Jan 3, 2026

not measurable as I can see it.

I came to this change because in php-src they seem to try hard to auto-detect "static callback" as it seems there can be some benefit in it: php/php-src#19941

I am fine with closing in case you don't like it

@ondrejmirtes ondrejmirtes merged commit 11034df into phpstan:2.1.x Jan 3, 2026
635 of 644 checks passed
@ondrejmirtes
Copy link
Member

It's okay :)

@staabm staabm deleted the statics branch January 3, 2026 12:16
@iluuu1994
Copy link
Contributor

Side-note: The caching of static closures has an additional restriction.

The PR also adds caching for static closures that don't have any bindings and don't declare static variables.

The binding disqualifies the closure from being cached, so this won't benefit either way.

@staabm
Copy link
Contributor Author

staabm commented Jan 3, 2026

Thanks for noting!

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.

3 participants