#48955 [Opn]: different namespace passing to autoloader
| From: | jani@php.net | Date: | Fri, 17 Jul 2009 11:27:36 +0000 |
| Subject: | #48955 [Opn]: different namespace passing to autoloader | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139863@lists.php.net to get a copy of this message | ||
ID: 48955
Updated by: jani@php.net
Reported By: schunke at gmx dot net
Status: Open
Bug Type: Scripting Engine problem
-Operating System: all
+Operating System: *
PHP Version: 5.3.0
New Comment:
I don't know OS called "all".. :)
Previous Comments:
------------------------------------------------------------------------
[2009-07-17 09:53:21] schunke at gmx dot net
Description:
------------
Theres a difference in namespace passing to an autoloader. That may
cause several problems and it should be the same.
Reproduce code:
---------------
<?php
function __autoload($value) {
echo $value;
}
new \ns\className;
$a = "\ns\className";
new $a;
?>
Expected result:
----------------
Same passing of namespace to autoloader as
new \ns\className -> ns\className
and
$a = "\ns\className";
new $a; -> ns\className
Actual result:
--------------
new \ns\className -> autoloader gets ns\className
$a = "\ns\className";
new $a; -> autoloader gets \ns\className (the first
backslash is the problem)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48955&edit=1