3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_func($arg1 = 'a', $arg2 = 'b', $arg3 = 'c', $arg4 = 'd') { return json_encode([ 'func_num_args' => func_num_args(), 'func_get_args' => func_get_args(), 'direct_args' => [$arg1, $arg2, $arg3, $arg4], ], JSON_PRETTY_PRINT); } echo test_func('hello', 'b', 'world');

preferences:
133.65 ms | 404 KiB | 5 Q