Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

With first-class callables now allowed in attributes since PHP 8.5, it might become more common to find named closures in exported objects.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I have a question about naming.


Is it something we could leverage for dumping object-bound closures in the DIC? Like #61656. But we don't serialize objects in DI arguments anyway, so it's probably a bad idea.

@nicolas-grekas
Copy link
Member Author

I wouldn't add that to general DI values yet. The closure() function will allow it anyway, properly.

@fabpot
Copy link
Member

fabpot commented Sep 6, 2025

Thank you @nicolas-grekas.

@fabpot fabpot merged commit a9dcea4 into symfony:7.4 Sep 6, 2025
7 of 12 checks passed
@nicolas-grekas nicolas-grekas deleted the ve-named-closures branch September 9, 2025 16:02
This was referenced Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants