From: markus dot ast at hotmail dot de
Operating system: Vista x64
PHP version: 5.3CVS-2008-06-06 (snap)
PHP Bug Type: Class/Object related
Bug description: new $classname(); dont works with namespaces
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 bug report at http://bugs.php.net/?id=45197&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45197&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45197&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45197&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45197&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45197&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45197&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45197&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45197&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45197&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45197&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45197&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45197&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45197&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45197&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45197&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45197&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45197&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45197&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45197&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45197&r=mysqlcfg