CakeFest 2024: The Official CakePHP Conference

CachingIterator::hasNext

(PHP 5, PHP 7, PHP 8)

CachingIterator::hasNext内部イテレータが有効な次の要素を持つかどうかをチェックする

説明

public CachingIterator::hasNext(): bool
警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

この関数にはパラメータはありません。

戻り値

成功した場合に true を、失敗した場合に false を返します。

add a note

User Contributed Notes 1 note

up
7
andresdzphp at php dot net
12 years ago
CachingIterator::hasNext Example

<?php
$ait
= new ArrayIterator(array('Value 1', 'Value 2', 'Value 3', 'Value 4'));
$cit = new CachingIterator($ait);

foreach (
$cit as $value) {
echo
$value;
//if has a next value, print a comma
if ($cit->hasNext()) {
echo
', ';
}
}
?>

Result: Value 1, Value 2, Value 3, Value 4
To Top