3v4l.org

run code in 300+ PHP versions simultaneously
<?php function userland_call_user_func(callable $function, ...$args) { return $function(...$args); } class Test { private function foo($bar) { echo new Exception; } public function call($callfunc) { $callfunc(array($this, 'foo'), 'bar'); } } $o = new Test; $o->call('call_user_func'); $o->call('userland_call_user_func');
Output for git.master, git.master_jit, rfc.property-hooks
Exception in /in/7ZCOM:6 Stack trace: #0 [internal function]: Test->foo('bar') #1 /in/7ZCOM(7): call_user_func(Array, 'bar') #2 /in/7ZCOM(11): Test->call('call_user_func') #3 {main} Fatal error: Uncaught TypeError: userland_call_user_func(): Argument #1 ($function) must be of type callable, array given, called in /in/7ZCOM on line 7 and defined in /in/7ZCOM:3 Stack trace: #0 /in/7ZCOM(7): userland_call_user_func(Array, 'bar') #1 /in/7ZCOM(12): Test->call('userland_call_u...') #2 {main} thrown in /in/7ZCOM on line 3
Process exited with code 255.

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