You might also want to look at the function-handling functions ([man]func_get_args[/man] and co.), that will allow access to all of the arguments passed to the function, however many there were (as can be done with [man]sprintf[/man] and the other functions with "[mixed, ...]" in their signatures).
Using those functions you can find out how many arguments were passed, get any argument in that collection, get the whole lot in an array and, with the variable-handling functions, find out what types they were. With all that information in hand, your code can then decide how to deal with each case (as in, for example, the way you can pass strings or arrays to [man]str_replace[/man]).