3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $instance = new class {}; $class_name = get_class($instance); $new_instance = new $class_name; class_alias($class_name, 'MyAlias'); var_dump($instance, $class_name, $new_instance, new MyAlias); // $x = "class@anonymous".chr(0).'/foo'; eval("class $x{}"); $d = get_declared_classes(); end($d); var_dump(current($d));
based on tCcI7
Output for 7.2.0
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7fe1152c501e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.10
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f4e1563401e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.7
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f1ac643001e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.6
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f373e19101e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.5
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7fa43904901e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.0
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f236590a01e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.20
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f51b77a901e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.6
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f6cc42c401e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.5
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f9fcf58601e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.4
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7ff5664d401e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.3
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f70e67f601e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.2
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f96a07e701e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.1
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7fbc7097e01e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.0
object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/RosBE0x7f2528bdf01e" object(class@anonymous)#2 (0) { } object(class@anonymous)#3 (0) { } Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/RosBE(13) : 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/RosBE 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/RosBE on line 3
Process exited with code 255.