From: Operating system: Ubuntu 10.10 PHP version: 5.3.5 Package: *General Issues Bug Type: Bug Bug description:is_callable() returns false on callable functions when not specifying namespace
Description:
------------
First sorry, I can only test this case with PHP 5.3.3 but I
didn't find any bugs referring to is_callable() since then, so I
think it's worth reporting.
The problem is that is_callable() will return false if you don't
specify the eventual namespace you're using.
Test script:
---------------
<?php
namespace Foo;
function bar() {
return 'bar!';
}
var_dump(is_callable('bar'));
var_dump(is_callable('\Foo\bar'));
var_dump(bar());
var_dump(\Foo\bar());
Expected result:
----------------
bool(false)
bool(true)
string(4) "bar!"
string(4) "bar!"
Actual result:
--------------
bool(true)
bool(true)
string(4) "bar!"
string(4) "bar!"
--
Edit bug report at http://bugs.php.net/bug.php?id=54171&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54171&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54171&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=54171&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54171&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=54171&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54171&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=54171&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=54171&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=54171&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=54171&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=54171&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=54171&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=54171&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54171&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54171&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54171&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=54171&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=54171&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=54171&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=54171&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=54171&r=mysqlcfg
