3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Foo; class Loader { public function __construct() { spl_autoload_register([$this, 'load']); } public static function load() {} } spl_autoload_register(['Loader', 'load']); new Loader(); var_dump(spl_autoload_functions());
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught LogicException: Passed array does not specify an existing static method (class 'Loader' not found) in /in/0P7m3:9 Stack trace: #0 /in/0P7m3(9): spl_autoload_register(Array) #1 {main} thrown in /in/0P7m3 on line 9
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Fatal error: Uncaught exception 'LogicException' with message 'Passed array does not specify an existing static method (class 'Loader' not found)' in /in/0P7m3:9 Stack trace: #0 /in/0P7m3(9): spl_autoload_register(Array) #1 {main} thrown in /in/0P7m3 on line 9
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/0P7m3 on line 5
Process exited with code 255.