HH\Iterator::valid

( excerpt from http://php.net/manual/en/iterator.valid.php )

public function valid(): bool;

This method is called after Iterator::rewind() and Iterator::next() to check if the current position is valid.

Returns

  • mixed - The return value will be casted to boolean and then evaluated. Returns TRUE on success or FALSE on failure.