Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReflectionFunction::isAnonymous() #8499

Closed
wants to merge 1 commit into from

Conversation

nicolas-grekas
Copy link
Contributor

As proposed at https://externals.io/message/116282

This would be very much appreciated instead of doing str_contains((new ReflectionFunction($f))->name, '{closure}').

In Symfony, we use this check in many places to display user-friendly names for closures.

Copy link
Contributor

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

I think this needs more tests. isAnonymous should always return false if a legacy callable was used.

ext/reflection/php_reflection.c Outdated Show resolved Hide resolved
@nicolas-grekas nicolas-grekas force-pushed the anonymous-closure branch 2 times, most recently from d2f6161 to 17dfc05 Compare May 5, 2022 14:52
@nicolas-grekas
Copy link
Contributor Author

nicolas-grekas commented May 5, 2022

PR should be ready. Failures are unrelated to me.

@cmb69 cmb69 closed this in be11bcb May 9, 2022
@cmb69
Copy link
Contributor

cmb69 commented May 9, 2022

Thank you!

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.

None yet

7 participants