Iterable objects and array type hinting?
I think you mean instanceof Iterator, PHP doesn’t have an Iterable interface. It does have a Traversable interface though. Iterator and IteratorAggregate both extend Traversable (and AFAIK they are the only ones to do so). But no, objects implementing Traversable won’t pass the is_array() check, nor there is a built-in is_iterable() function. A check you … Read more