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', 'Foo::do_foo', array(new Foo(), 'do_foo'), function () { echo __FUNCTION__, "\n"; }, ); foreach ($funs as $fun) { echo "direct call: "; $fun(); echo "call_user_func(): "; call_user_func($fun); }
Output for git.master, git.master_jit, rfc.property-hooks
direct call: foo1 call_user_func(): foo1 direct call: Foo::do_foo call_user_func(): Foo::do_foo direct call: Foo::do_foo call_user_func(): Foo::do_foo direct call: {closure} call_user_func(): {closure}

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:
35.45 ms | 401 KiB | 8 Q