3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $instance = new class {}; $class_name = "class@anonymous".chr(0).__FILE__.'0x7f14cee1501e'; 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 6sZrf
Output for 7.2.0
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f53aff4301e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.1.10
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f092ef9601e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.1.7
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7fbbff29701e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.1.6
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f1d2aa0201e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.1.5
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f1ee53e301e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.1.0
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7fa9364e501e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.20
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7ff187e4701e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.6
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7eff77cda01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.5
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f5b945cf01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.4
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7efdc504501e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.3
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7fbb3031d01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.2
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f788267701e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.1
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7fb69266e01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM on line 11
Process exited with code 255.
Output for 7.0.0
Warning: Class 'class@anonymous' not found in /in/2XSGM on line 6 string(39) "class@anonymous/in/2XSGM0x7f8025ecb01e" Fatal error: Uncaught Error: Class 'class@anonymous' not found in /in/2XSGM:11 Stack trace: #0 {main} thrown in /in/2XSGM 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/2XSGM 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/2XSGM on line 3
Process exited with code 255.