ID: 45197
User updated by: markus dot ast at hotmail dot de
Reported By: markus dot ast at hotmail dot de
-Status: Wont fix
+Status: Closed
Bug Type: Class/Object related
Operating System: Vista x64
PHP Version: 5.3CVS-2008-06-06 (snap)
New Comment:
Okay, good to know, thanks!
Previous Comments:
------------------------------------------------------------------------
[2008-06-06 23:59:00] [EMAIL PROTECTED]
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.
------------------------------------------------------------------------
[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