1--TEST-- 2Variable as class name for new expression 3--FILE-- 4<?php 5 6$className = 'stdClass'; 7$array = ['className' => 'stdClass']; 8$obj = (object) ['className' => 'stdClass']; 9 10class Test { 11 public static $className = 'stdClass'; 12} 13$test = 'Test'; 14$weird = [0 => (object) ['foo' => 'Test']]; 15 16var_dump(new $className); 17var_dump(new $array['className']); 18var_dump(new $array{'className'}); 19var_dump(new $obj->className); 20var_dump(new Test::$className); 21var_dump(new $test::$className); 22var_dump(new $weird[0]->foo::$className); 23 24?> 25--EXPECTF-- 26Deprecated: Array and string offset access syntax with curly braces is deprecated in %s on line %d 27object(stdClass)#%d (0) { 28} 29object(stdClass)#%d (0) { 30} 31object(stdClass)#%d (0) { 32} 33object(stdClass)#%d (0) { 34} 35object(stdClass)#%d (0) { 36} 37object(stdClass)#%d (0) { 38} 39object(stdClass)#%d (0) { 40} 41