You can also look at [man]func_num_args[/man]; this only counts arguments supplied by the caller, and not any defaults that may have been used. So to laserlight's
function foo($arg1, $arg2, $arg3 = false, $arg4 = null)
foo(42,17) is supplying two arguments,
foo(41,17,true) is supplying three, and
foo(40, 16, false, 'handball', array('not','a','nice','doggy')) is supplying five.
func_num_args() would return 2, 3, and 5, respectively.