| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2011-02-26 13:20 UTC] cataphract@php.net
 
-Type: Bug
+Type: Feature/Change Request
  [2011-02-26 13:22 UTC] johannes@php.net
 
-Status: Open
+Status: Bogus
  [2011-02-26 13:22 UTC] johannes@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
Description: ------------ When creating a new object reference with variables and namespaces (tested with aliasing namespaces [use namespace as alias] and not [\long\namespace\path]) and it fails in both scenarios. This works without the use of namespaces. This bug seems like an overlooked feature. Test script: --------------- # test.php <?php use Test as T; require "namespace_test.php"; $name = "MyClass"; $obj = new T\$name; ?> # namespace_test.php <?php namespace Test { class MyClass { function __construct() { echo "Testing!"; } } } ?> Expected result: ---------------- Testing! Actual result: -------------- Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in test.php on line 5