3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php spl_autoload_register(function($name){ if($name == 'C') { spl_autoload_register(function($name){ if($name == 'C') { class C { function __construct(){ echo "I'm C.\n"; } } } }); } }); $c = new C();
Output for 5.5.0 - 5.6.30, 7.0.3 - 7.2.0
I'm C.
Output for 7.0.0 - 7.0.2
Fatal error: Uncaught Error: Class 'C' not found in /in/f1njG:16 Stack trace: #0 {main} thrown in /in/f1njG on line 16
Process exited with code 255.
Output for hhvm-3.11.1 - 3.17.3
Fatal error: Uncaught Error: Class undefined: C in /in/f1njG:16 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Class undefined: C in /in/f1njG on line 16
Process exited with code 255.