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

is_callable(func(...), callable_name: $name) for first class callables returns wrong name #18062

Closed
TimWolla opened this issue Mar 14, 2025 · 0 comments · Fixed by #18063
Closed

Comments

@TimWolla
Copy link
Member

Description

The following code:

<?php

function some_func() {

}

$callable = some_func(...);
is_callable($callable, callable_name: $name);
var_dump($name);
var_dump((new ReflectionFunction($callable))->getName());

Resulted in this output:

string(17) "Closure::__invoke"
string(9) "some_func"

But I expected this output instead:

string(9) "some_func"
string(9) "some_func"

PHP Version

git amster

Operating System

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant