ID: 45197
Updated by: [EMAIL PROTECTED]
Reported By: markus dot ast at hotmail dot de
-Status: Open
+Status: Wont fix
Bug Type: Class/Object related
Operating System: Vista x64
PHP Version: 5.3CVS-2008-06-06 (snap)
New Comment:
Dynamic class references require the fully qualified class name (with
the namespace in it) because at runtime there is no information about
the current namespace.
Previous Comments:
------------------------------------------------------------------------
[2008-06-06 23:53:22] markus dot ast at hotmail dot de
Description:
------------
first: sry for my english (I am german)
Trying to dynamicly declarate a class in a namespace doesnt works. It
doesn't searches in the current namespace, if this class is present. It
just searches in the global namespace.
Reproduce code:
---------------
<?php
namespace Level1::Level2;
class Example
{
public function __construct()
{
echo 'works!';
}
}
$classname = 'Example';
new $classname();
?>
Expected result:
----------------
Fatal error: Class 'Example' not found in test.php on line 11
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45197&edit=1