global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / function_varargs.php
blob4bc4d7458966dbb55cddae9dc1b6704349f2c3b4
1 <?hh
3 function func_num_args_simple() {
4 return func_num_args();
7 function func_num_args_arg($arg) {
8 return func_num_args();
12 function test(string $generator, array $args) {
13 var_dump(call_user_func_array($generator, $args));
16 function test_num_args(string $type, array $extra_args, mixed ...$more_args) {
17 test(
18 'func_num_args_'.$type,
19 array_merge(
20 $more_args,
21 $extra_args
26 $extra_args_set = array(
27 array(),
28 array('hello'),
29 array('hello', 47),
32 foreach ($extra_args_set as $extra_args) {
33 test_num_args('simple', $extra_args);
35 test_num_args('arg', $extra_args, 'defined_arg');