Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Mar 17, 2025
    6962540
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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