3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php spl_autoload_register(new class { public function __construct() { var_dump('waa'); } public function __invoke($method) { var_dump($method); } }); new A;
Output for 7.0.0 - 7.3.0beta1
string(3) "waa" string(1) "A" Fatal error: Uncaught Error: Class 'A' not found in /in/Uu9aO:16 Stack trace: #0 {main} thrown in /in/Uu9aO on line 16
Process exited with code 255.
Output for 5.6.0 - 5.6.24
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/Uu9aO on line 3
Process exited with code 255.