func_get_args()
function foo() { return func_get_args(); } echo foo(1,5,7,3);//output 4; echo foo(a,b);//output 2; echo foo();//output 0;