Let's say you are building an API that other people will work with.
And you use typehinting a lot for functions, like function foo(array $arg){...}
. This forces the argument to be an array, so passing traversable objects to this function won't work. But your function can work with such objects.
Do you think it's a good idea to remove the hint and handle traversable objects too? Or should I leave that to the user? (she can use iterator_to_array
for example)