Traversable¶
Traversable is a specific PHP interface that represents an object that can be iterated over.
Traversable is an abstract interface: it cannot be implemented directly, and instead, it must be implemented by either IteratorAggregate or Iterator.
The traversable interface is used for typing purposes.
<?php
try {
doSomething();
} catch (\Traversable $e) {
print "Some error was raised during processing: ". $e::class;
}
?>
See also Traversable interface in PHP.
Related : Exception, Error, Iterable, OuterIterator, PHP Native Interfaces, yield from Keyword, IteratorAggregate