|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53920 is_callable is invoking autoloading incorrectly
Submitted: 2011-02-03 19:56 UTC Modified: 2011-02-04 12:40 UTC
Avg. Score:2.0 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: rubs33 at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID: None
 [2011-02-03 19:56 UTC] rubs33 at gmail dot com
When you set a string variable with a value like "return any_class::any_method();" and use it on "is_callable" PHP core function, the autoloading is invoked trying to load a class named "return any_class".

Test script:

function __autoload($class) {
    printf("Required class: '%s'\n", $class);

$code =	'return foo::bar();';


Expected result:

Actual result:
Required class: 'return foo'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-04 10:27 UTC]
-Status: Open +Status: Wont fix
 [2011-02-04 10:27 UTC]
I don't think there's any real value in trying to make is_callable()
smarter in this case. Garbage in, garbage out.
 [2011-02-04 12:40 UTC] rubs33 at gmail dot com
-Status: Wont fix +Status: Closed
 [2011-02-04 12:40 UTC] rubs33 at gmail dot com
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 00:01:23 2021 UTC