3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$bar) { $bar = 1; return 1; } $arg = 0; $called = 0; $called=call_user_func_array2('foo', array(0)); var_dump(array('arg'=>$arg, 'called'=>$called)); $arg = 0; $called = 0; $called=call_user_func_array2('foo', array($arg)); var_dump(array('arg'=>$arg, 'called'=>$called)); $arg = 0; $called = 0; $called=call_user_func_array2('foo', array(&$arg)); var_dump(array('arg'=>$arg, 'called'=>$called)); function call_user_func_array2($f, $args) { $args2=array(); foreach($args as $k=>$v) $args2[$k] = &$args[$k]; return call_user_func_array($f, $args2); }
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["arg"]=> int(0) ["called"]=> int(1) } array(2) { ["arg"]=> int(0) ["called"]=> int(1) } array(2) { ["arg"]=> int(1) ["called"]=> int(1) }

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.08 ms | 401 KiB | 8 Q