3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Foo; class Loader { public function __construct() { spl_autoload_register(static::load); } public static function load() {} } spl_autoload_register(['Foo\Loader', 'load']); new Loader(); var_dump(spl_autoload_functions());
based on 9rd3M
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Undefined class constant 'load' in /in/TmK1n:5 Stack trace: #0 /in/TmK1n(10): Foo\Loader->__construct() #1 {main} thrown in /in/TmK1n on line 5
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Fatal error: Undefined class constant 'load' in /in/TmK1n on line 5
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/TmK1n on line 9
Process exited with code 255.