From: Operating system: Linux 3.3.4 PHP version: 5.3.12 Package: Class/Object related Bug Type: Bug Bug description:Instanciate object for aliased class
Description: ------------ Creating a class from variable when it has been imported with use keyword fails with class not found error. This problems persists in 5.3.11, 5.3.12 and 5.4.1 Test script: --------------- use stdClass as Foo; $class = "Foo"; new $class; Expected result: ---------------- No output Actual result: -------------- PHP Fatal error: Class 'Foo' not found in /tmp/test.php on line 6 PHP Stack trace: PHP 1. {main}() /tmp/test.php:0 Fatal error: Class 'Foo' not found in /tmp/test.php on line 6 Call Stack: 0.0003 631856 1. {main}() /tmp/test.php:0 -- Edit bug report at https://bugs.php.net/bug.php?id=61928&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61928&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61928&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61928&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61928&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61928&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61928&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61928&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61928&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61928&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61928&r=support Expected behavior: https://bugs.php.net/fix.php?id=61928&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61928&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61928&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61928&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61928&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61928&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61928&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61928&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61928&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61928&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61928&r=mysqlcfg