#48955 [Bgs]: different namespace passing to autoloader
ID: 48955
Updated by: jani@php.net
Reported By: schunke at gmx dot net
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.3.0
New Comment:
See also:
http://www.php.net/manual/en/language.namespaces.faq.php#language.namesp
aces.faq.full
Previous Comments:
------------------------------------------------------------------------
[2009-07-24 09:25:44] jani@php.net
\n inside double quotes is escape char of newline. No bug here.
------------------------------------------------------------------------
[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
Thread (4 messages)