Should there be a check for what happens if arg_count is way smaller than arg_num? I.e. if I call foo($a = 1, $b = 1, $c = 1, ...$params) with foo(), wouldn't arg_count be 0 and arg_num 4? then you'd allocate array of size -2.