3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $instance = new class {}; $c = get_class($instance); $buf = substr($c, -14); $class_name = "class@anonymous".chr(0).__FILE__.$buf; eval("$class_name extends stdClass {};"); var_dump(new $class_name);
based on cInXT
Output for 7.0.0 - 7.2.0
Parse error: syntax error, unexpected '@', expecting identifier (T_STRING) in /in/FfH9b(9) : eval()'d code on line 1
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/FfH9b on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/FfH9b on line 3
Process exited with code 255.