3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyClass { public function xAction(){ return true; } } $closure = function(){ return true; }; $controller = [new MyClass, 'xAction']; var_dump(new ReflectionFunction($controller));
based on nVbcb
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: ReflectionFunction::__construct() expects parameter 1 to be string, array given in /in/L3v1e:14 Stack trace: #0 /in/L3v1e(14): ReflectionFunction->__construct(Array) #1 {main} thrown in /in/L3v1e on line 14
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Warning: ReflectionFunction::__construct() expects parameter 1 to be string, array given in /in/L3v1e on line 14 object(ReflectionFunction)#3 (1) { ["name"]=> string(0) "" }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/L3v1e on line 13
Process exited with code 255.