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

From: Date: Fri, 04 Feb 2011 09:27:26 +0000
Subject: Bug #53920 [Opn->Wfx]: is_callable is invoking autoloading incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158469@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 Updated by: aharvey@php.net Reported by: rubs33 at gmail dot com Summary: is_callable is invoking autoloading incorrectly -Status: Open +Status: Wont fix Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: I don't think there's any real value in trying to make is_callable() smarter in this case. Garbage in, garbage out. Previous Comments: ------------------------------------------------------------------------ [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 (#158469) next »