<?php
spl_autoload_register('var_dump');
spl_autoload_register(function ($class) {
eval('class '.$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/5WrH1(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/5WrH1(5) : eval()'d code on line 1
Fatal error: Class 'Foo\Bar' not found in /in/5WrH1 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/5WrH1(5) : eval()'d code on line 1
Fatal error: Class 'Foo\Bar' not found in /in/5WrH1 on line 12
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/5WrH1 on line 4
Process exited with code 255.