<?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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- int(3)
Fatal error: Uncaught Error: Cannot call func_num_args() dynamically in /in/inP5v:12
Stack trace:
#0 [internal function]: func_num_args()
#1 /in/inP5v(12): call_user_func('func_num_args')
#2 /in/inP5v(14): Foo\test(1, 2, 3)
#3 {main}
thrown in /in/inP5v on line 12
Process exited with code 255. - Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
- int(3)
Warning: Cannot call func_num_args() dynamically in /in/inP5v on line 12
int(-1)
- Output for 7.0.0 - 7.0.33
- int(3)
int(1)
- Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
- int(1)
int(1)
preferences:
149.41 ms | 410 KiB | 5 Q