略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Generator::valid

2024-04-29

Generator::valid

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

Generator::valid检查迭代器是否被关闭

说明

public Generator::valid(): bool

参数

此函数没有参数。

返回值

如果迭代器已被关闭返回 false,否则返回 true

add a noteadd a note

User Contributed Notes 1 note

up
2
Igor Frolov
3 years ago
Notice if you call it with open empty generator, it will close while checking.

官方地址:https://www.php.net/manual/en/generator.valid.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3