<?php
spl_autoload_register('var_dump');
spl_autoload_register(function ($class) {
eval('class '.ltrim($class, '\\').' { }');
});
new Foo();
new \Foo();
use Foo\Bar;
new Bar();
use Foo\Baz as Cat;
new Cat();
use Foo\Ciz;
new Ciz\Caz();
string(3) "Foo"
string(7) "Foo\Bar"
Parse error: syntax error, unexpected namespaced name "Foo\Bar", expecting identifier in /in/AYnR5(5) : eval()'d code on line 1
Process exited with code 255.
string(3) "Foo"
string(7) "Foo\Bar"
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting '{' in /in/AYnR5(5) : eval()'d code on line 1
Fatal error: Class 'Foo\Bar' not found in /in/AYnR5 on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.29
string(3) "Foo"
string(7) "Foo\Bar"
Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting '{' in /in/AYnR5(5) : eval()'d code on line 1
Fatal error: Class 'Foo\Bar' not found in /in/AYnR5 on line 12
Process exited with code 255.