CachingIterator::valid

(PHP 5, PHP 7, PHP 8)

CachingIterator::valid — Check whether the current element is valid

Description

public function CachingIterator::valid(): bool

Checks whether the current element is valid.

A CachingIterator has no current element until CachingIterator::rewind() is called, which foreach does automatically.

Parameters

This function has no parameters.

Return Values

Returns true if the current element is valid, false otherwise.

See Also