OuterIterator::getInnerIterator

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

OuterIterator::getInnerIteratorReturns the inner iterator for the current entry

说明

public OuterIterator::getInnerIterator ( ) : Iterator|null

Returns the inner iterator for the current iterator entry.

参数

此函数没有参数。

返回值

Returns the inner iterator for the current entry if it exists, or null otherwise.

User Contributed Notes

Sjakie Pruts 07-Aug-2019 12:49
The return type is merely documented here, it's not actually enforced. For instance, the IteratorIterator implementation can return Traversable, which would break the interface. Most likely, this is for backwards compatibility with code written before return type hints existed. It's still possible to create your own namespaced OuterIterator interface that extends the global one and add a typehint for this method in there.
PHP8中文手册 站长在线 整理 版权归PHP文档组所有