3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $instance = new class {}; $class_name = "class@anonymous".chr(0).__FILE__; class_alias($class_name, 'MyAlias'); $d = get_declared_classes(); end($d); var_dump(current($d)); var_dump(new $class_name); var_dump(new MyAlias);
based on eMcN2
Output for 7.2.0
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f9b990bd01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.1.10
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f4bb788601e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.1.7
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f5ffa20e01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.1.6
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7ff90839901e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.1.5
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f45aa4ac01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.1.0
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7feab2e6101e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.20
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f3fd0af201e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.6
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f5d93e9101e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.5
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f16873c701e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.4
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f17b8bef01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.3
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f1d4325a01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.2
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7f6f84a3901e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.1
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7fe8de2a901e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 7.0.0
Warning: Class 'class@anonymous' not found in /in/6sZrf on line 6 string(39) "class@anonymous/in/6sZrf0x7fed68df801e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/6sZrf:11 Stack trace: #0 {main} thrown in /in/6sZrf on line 11
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/6sZrf 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/6sZrf on line 3
Process exited with code 255.