3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Example { public function match(callable $cb) { echo $cb(); } } class Callee { public function yo() { return "If I show up, I'm allowed to do this!"; } } $ex = new Example(); $callee = new Callee(); $ex->match([$callee, 'yo']);
based on JJ8kR
Output for 5.4.0 - 7.2.0
If I show up, I'm allowed to do this!
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/ZWoes on line 21
Process exited with code 255.