3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function test($a, $b, $c) { var_dump(call_user_func('func_num_args')); } test(1, 2, 3); } namespace Foo { function test($a, $b, $c) { var_dump(call_user_func('func_num_args')); } test(1, 2, 3); }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
int(3) Fatal error: Uncaught Error: Cannot call func_num_args() dynamically in /in/JT99E:11 Stack trace: #0 [internal function]: func_num_args() #1 /in/JT99E(11): call_user_func('func_num_args') #2 /in/JT99E(13): Foo\test(1, 2, 3) #3 {main} thrown in /in/JT99E on line 11
Process exited with code 255.
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
int(3) Warning: Cannot call func_num_args() dynamically in /in/JT99E on line 11 int(-1)
Output for 7.0.0 - 7.0.20
int(3) int(1)
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
int(1) int(1)

preferences:
175.9 ms | 402 KiB | 225 Q