Skip to content

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

Closed
@TimWolla

Description

@TimWolla

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions