3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo1() { echo __FUNCTION__, "\n"; } class Foo { static function do_foo() { echo __METHOD__, "\n"; } } $funs = array( 'foo1', array(new Foo(), 'do_foo'), function () { echo __FUNCTION__, "\n"; }, array('Foo', 'do_foo'), ); foreach ($funs as $fun) { echo "call_user_func(): "; call_user_func($fun); echo "direct call: "; $fun(); }
Output for git.master, git.master_jit, rfc.property-hooks
call_user_func(): foo1 direct call: foo1 call_user_func(): Foo::do_foo direct call: Foo::do_foo call_user_func(): {closure} direct call: {closure} call_user_func(): Foo::do_foo direct call: Foo::do_foo

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
48.06 ms | 401 KiB | 8 Q