instance of Traversable,
// a TypeError will be thrown.
function foo(iterable $iterable) {
foreach ($iterable as $value) {
// ...
}
}
// If the returned value is not an array
// or instance of Traversable, a TypeError will be thrown.
function bar(): iterable {
return [1, 2, 3];
}
// Parameters declared as iterable
// may use null or an array as a default value
function foo(iterable $iterable = []) {
// ...
}