CachingIterator 类
(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。 |
更新日志
| 版本 | 说明 |
|---|---|
| 8.4.0 | 类常量现在是有类型的。 |
目录
- CachingIterator::__construct — Construct a new CachingIterator object for the iterator
- CachingIterator::count — Return the number of elements in the cache
- CachingIterator::current — Return the current element
- CachingIterator::getCache — Retrieve the contents of the cache
- CachingIterator::getFlags — Get flags used
- CachingIterator::hasNext — Check whether the inner iterator has a valid next element
- CachingIterator::key — Return the key for the current element
- CachingIterator::next — Move the iterator forward
- CachingIterator::offsetExists — Check whether an element exists in the cache
- CachingIterator::offsetGet — Return an element from the cache
- CachingIterator::offsetSet — Set an element in the cache
- CachingIterator::offsetUnset — Remove an element from the cache
- CachingIterator::rewind — Rewind the iterator
- CachingIterator::setFlags — Set the flags for the CachingIterator object
- CachingIterator::__toString — Return the string representation of the current element
- CachingIterator::valid — Check whether the current element is valid
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
