3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a {} function foo() {} foreach (["substr", "foo"] as $fn) { $x = (new ReflectionFunction($fn))->getClosure(); Closure::bind($x, new a, "a"); } ?>
based on oHW7B
Output for 7.0.0 - 7.2.0
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in /in/1402e on line 8 Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in /in/1402e on line 8
Output for 5.4.2 - 5.6.28
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/1402e on line 6
Process exited with code 255.