3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo 11; set_error_handler(function($errno, $errstr, $errfile, $errline){ echo $errstr."\n"; new MyClass; }); spl_autoload_register(function($class){ echo $class."\n"; return eval("class $class{}"); }); echo 22; eval(' echo 33; class MyConcrete extends MyAbstract { public static function createInstance() {} } echo 44; abstract class MyAbstract { public abstract static function createInstance(); } ');
based on u9JZi
Output for 7.0.0 - 7.2.0
11223344
Output for 5.4.21 - 5.6.28
1122Static function MyAbstract::createInstance() should not be abstract MyClass 3344
Output for 5.3.21 - 5.4.20
1122Static function MyAbstract::createInstance() should not be abstract Fatal error: Class 'MyClass' not found in /in/a2NrQ(25) : eval()'d code on line 8
Process exited with code 255.