array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'class.cachingiterator.php', 1 => 'CachingIterator', ), 'up' => array ( 0 => 'spl.iterators.php', 1 => '迭代器', ), 'prev' => array ( 0 => 'arrayiterator.valid.php', 1 => 'ArrayIterator::valid', ), 'next' => array ( 0 => 'cachingiterator.construct.php', 1 => 'CachingIterator::__construct', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/spl/cachingiterator.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.cachingiterator.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
该对象支持在另一迭代器上缓存迭代。
CachingIterator::CALL_TOSTRING
每个元素转换为字符串。
CachingIterator::CATCH_GET_CHILD
访问子元素时不要抛出异常。
CachingIterator::TOSTRING_USE_KEY
转换为字符串时使用 key。
CachingIterator::TOSTRING_USE_CURRENT
转换为字符串时使用 current。
CachingIterator::TOSTRING_USE_INNER
转换为字符串时使用 inner。
CachingIterator::FULL_CACHE
缓存所有读取的数据。
版本 | 说明 |
---|---|
8.0.0 | CachingIterator 现在实现了 Stringable。 |