ID: 47568
Updated by: [email protected]
Reported By: ice dot wynn at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: windows vista
PHP Version: 5.3CVS-2009-03-05 (snap)
New Comment:
Importing is performed at compile-time, and so does not affect dynamic
class, function or constant names.
Previous Comments:
------------------------------------------------------------------------
[2009-03-05 05:38:33] ice dot wynn at gmail dot com
Description:
------------
The parameter of __autoload() is wrong when using a variable to
instantiate a namespaced class with aliasing namespace.
Reproduce code:
---------------
<?php
//file 1
function __autoload($className){
var_dump($className);
//require($className.'.php');
exit;
}
use Foo as Bar;
new Bar\SomeClass;
?>
<?php
//file 2
function __autoload($className){
var_dump($className);
//require($className.'.php');
exit;
}
use Foo as Bar;
$class = 'Bar\SomeClass';
new $class;
?>
Expected result:
----------------
file 1:
string(13) "Foo\SomeClass"
file 2:
string(13) "Foo\SomeClass"
Actual result:
--------------
file 1:
string(13) "Foo\SomeClass"
file 2:
string(13) "Bar\SomeClass"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47568&edit=1