#49143 [Opn->Fbk]: is_callable() and unnecessary backslash
| From: | jani@php.net | Date: | Tue, 04 Aug 2009 11:16:08 +0000 |
| Subject: | #49143 [Opn->Fbk]: is_callable() and unnecessary backslash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140635@lists.php.net to get a copy of this message | ||
ID: 49143
Updated by: jani@php.net
Reported By: david at grudl dot com
-Status: Open
+Status: Feedback
Bug Type: Class/Object related
Operating System: *
PHP Version: 5.3.0
New Comment:
Yes, which problem..? I don't see any errors.
Previous Comments:
------------------------------------------------------------------------
[2009-08-04 00:34:46] david at grudl dot com
Tested with 5.3.1-dev (Sun, 02 Aug 2009 18:53:57 +0000), problem still
exists.
------------------------------------------------------------------------
[2009-08-03 23:12:04] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2009-08-03 16:19:59] david at grudl dot com
Description:
------------
is_callable() and method_exists() may invoke autoloader with
unnecessary namespace backslash.
\My\MyClass::func() is the same as My\MyClass::func().
Reproduce code:
---------------
function __autoload($name)
{
echo $name;
}
is_callable('\My\MyClass::func'); // ERROR
is_callable('My\MyClass::func'); // OK
method_exists('\My\MyClass', 'func'); // ERROR
method_exists('My\MyClass', 'func'); // OK
// defined works well:
defined('\My\MyClass::CONST'); // OK
defined('My\MyClass::CONST'); // OK
Expected result:
----------------
My\MyClass
My\MyClass
My\MyClass
My\MyClass
My\MyClass
My\MyClass
Actual result:
--------------
\My\MyClass
My\MyClass
\My\MyClass
My\MyClass
My\MyClass
My\MyClass
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49143&edit=1