略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: OuterIterator::getInnerIterator

2024-12-22

OuterIterator::getInnerIterator

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

OuterIterator::getInnerIteratorReturns the inner iterator for the current entry

说明

public OuterIterator::getInnerIterator(): ?Iterator

Returns the inner iterator for the current iterator entry.

参数

此函数没有参数。

返回值

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

add a noteadd a note

User Contributed Notes 1 note

up
0
Sjakie Pruts
2 years ago
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.

官方地址:https://www.php.net/manual/en/outeriterator.getinneriterator.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3