Bug #53920 [Wfx->Csd]: is_callable is invoking autoloading incorrectly

From: Date: Fri, 04 Feb 2011 11:40:13 +0000
Subject: Bug #53920 [Wfx->Csd]: is_callable is invoking autoloading incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158480@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53920&edit=1 ID: 53920 User updated by: rubs33 at gmail dot com Reported by: rubs33 at gmail dot com Summary: is_callable is invoking autoloading incorrectly -Status: Wont fix +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Ok. Previous Comments: ------------------------------------------------------------------------ [2011-02-04 10:27:26] 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-03 19:56:02] 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) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53920&edit=1

« previous php.bugs (#158480) next »