3v4l.org

run code in 300+ PHP versions simultaneously
<?php function userland_func_num_args() { return count(debug_backtrace()[1]['args'][$idx]); } function foo() { return func_num_args(); } function bar() { return userland_func_num_args(); } var_dump(foo('foo', 'bar')); var_dump(bar('foo', 'bar'));
Output for git.master, git.master_jit, rfc.property-hooks
int(2) Warning: Undefined variable $idx in /in/PkHEN on line 3 Warning: Undefined array key "" in /in/PkHEN on line 3 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/PkHEN:3 Stack trace: #0 /in/PkHEN(6): userland_func_num_args() #1 /in/PkHEN(9): bar('foo', 'bar') #2 {main} thrown in /in/PkHEN 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:
33.5 ms | 401 KiB | 8 Q