3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo1() { echo __FUNCTION__, "\n"; } class Foo { function do_foo() { echo __METHOD__, "\n"; } static function static_foo { echo __METHOD__, "\n"; } } $funs = array( 'foo1', array(new Foo(), 'do_foo'), function () { echo __FUNCTION__, "\n"; }, array('Foo', 'static_foo'), ); foreach ($funs as $fun) { echo "call_user_func(): "; call_user_func($fun); echo "direct call: "; $fun(); }
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '{', expecting '(' in /in/RYg5t on line 7
Process exited with code 255.