(PHP 5, PHP 7, PHP 8)
This object supports cached iteration over another iterator.
public count(): int
public current(): mixed
public getCache(): array
public getFlags(): int
public hasNext(): bool
public key(): scalar
public next(): void
public offsetExists(string $key): bool
public offsetGet(string $key): mixed
public offsetSet(string $key, mixed $value): void
public offsetUnset(string $key): void
public rewind(): void
public setFlags(int $flags): void
public __toString(): string
public valid(): bool
public IteratorIterator::current(): mixed
public IteratorIterator::getInnerIterator(): ?Iterator
public IteratorIterator::key(): mixed
public IteratorIterator::next(): void
public IteratorIterator::rewind(): void
public IteratorIterator::valid(): bool}
CachingIterator::CALL_TOSTRINGConvert every element to string.
CachingIterator::CATCH_GET_CHILDDon't throw exception in accessing children.
CachingIterator::TOSTRING_USE_KEYUse key for conversion to string.
CachingIterator::TOSTRING_USE_CURRENTUse current for conversion to string.
CachingIterator::TOSTRING_USE_INNERUse inner for conversion to string.
CachingIterator::FULL_CACHECache all read data.
| Version | Description |
|---|---|
| 8.0.0 | CachingIterator implements Stringable now. |
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.cachingiterator.php