Generator::valid
(PHP 5 >= 5.5.0)
Generator::valid — Check if the iterator has been closed
Description
public bool Generator::valid
( void
)
Parameters
This function has no parameters.
Return Values
Returns FALSE
if the iterator has been closed. Otherwise returns TRUE
.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник языка
- Встроенные интерфейсы и классы
- Функция Generator::current() - Get the yielded value
- Generator::getReturn
- Функция Generator::key() - Get the yielded key
- Функция Generator::next() - Resume execution of the generator
- Функция Generator::rewind() - Rewind the iterator
- Функция Generator::send() - Send a value to the generator
- Функция Generator::throw() - Throw an exception into the generator
- Функция Generator::valid() - Check if the iterator has been closed
- Функция Generator::__wakeup() - Serialize callback
Коментарии
Notice if you call it with open empty generator, it will close while checking.