Check if the iterator has been closed

- « Generator::throw

- Generator::__wakeup »

- PHP Manual
- Generator
- Check if the iterator has been closed

# Generator::valid

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

Generator::valid — Check if the iterator has been closed

### Description

public Generator::valid(): bool

### Parameters

This function has no parameters.

### Return Values

Returns `false` if the iterator has been closed. Otherwise returns `true`.