|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62689 get_callable_name function to avoid is_callable with callable type hint
Submitted: 2012-07-29 14:35 UTC Modified: 2020-09-17 14:32 UTC
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: franssen dot roland at gmail dot com Assigned:
Status: Suspended Package: Unknown/Other Function
PHP Version: 5.4.5 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: franssen dot roland at gmail dot com
New email:
PHP Version: OS:


 [2012-07-29 14:35 UTC] franssen dot roland at gmail dot com
Currently the callable name can only be fetched using is_callable and a 3rd argument. However this doesnt seem appropriate when using callable type hints..

get_callable_name (just like get_resource_type) would be in place imho.

Test script:
function foo(callable $bar) {
    $name = null;
    $name = is_callable($bar, true, $name);

    // vs

    $name = get_callable_name($bar);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-14 14:37 UTC]
Using is_callable() to get the name can be simplified:

  is_callable($bar, true, $name);

  $name = get_callable_name($bar);
That's not much of a difference. And of course, it is possible to
to write the desired function in userland code.
 [2020-09-17 14:32 UTC]
-Status: Open +Status: Suspended
 [2020-09-17 14:32 UTC]
If you're still interested in having get_callable_name(), please
forward this request to the internals mailing list[1], since this
feature needs to be discussed (besides that it's trivial to
implement the function in userland, the name wouldn't fit to our
naming scheme).  Thanks!  For the time being, I'm suspending this

[1] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 08:05:54 2022 UTC