php.net |  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
Votes:4
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rubs33 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-02-03 19:56 UTC] rubs33 at gmail dot com
Description:
------------
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:
---------------
<?php

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

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

var_dump(is_callable($code));

Expected result:
----------------
bool(false)

Actual result:
--------------
Required class: 'return foo'
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-04 10:27 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2011-02-04 10:27 UTC] aharvey@php.net
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
Ok.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 26 08:01:26 2020 UTC