1--TEST-- 2func_get_args() tests 3--FILE-- 4<?php 5 6function test1() { 7 var_dump(func_get_args()); 8} 9 10function test2($a) { 11 var_dump(func_get_args()); 12} 13 14function test3($a, $b) { 15 var_dump(func_get_args()); 16} 17 18test1(); 19test1(10); 20test2(1); 21test2(); 22test3(1,2); 23 24call_user_func("test1"); 25call_user_func("test3", 1); 26call_user_func("test3", 1, 2); 27 28class test { 29 static function test1($a) { 30 var_dump(func_get_args()); 31 } 32} 33 34test::test1(1); 35var_dump(func_get_args()); 36 37echo "Done\n"; 38?> 39--EXPECTF-- 40array(0) { 41} 42array(1) { 43 [0]=> 44 int(10) 45} 46array(1) { 47 [0]=> 48 int(1) 49} 50 51Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d 52array(0) { 53} 54array(2) { 55 [0]=> 56 int(1) 57 [1]=> 58 int(2) 59} 60array(0) { 61} 62 63Warning: Missing argument 2 for test3() in %s on line %d 64array(1) { 65 [0]=> 66 int(1) 67} 68array(2) { 69 [0]=> 70 int(1) 71 [1]=> 72 int(2) 73} 74array(1) { 75 [0]=> 76 int(1) 77} 78 79Warning: func_get_args(): Called from the global scope - no function context in %s on line %d 80bool(false) 81Done 82