CachingIterator::hasNext

(PHP 5, PHP 7)

CachingIterator::hasNextCheck whether the inner iterator has a valid next element

설명

public void CachingIterator::hasNext ( void )
Warning

이 함수는 현재 문서화 되어있지 않습니다; 인수 목록만을 제공합니다.

인수

이 함수는 인수가 없습니다.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

add a note add a note

User Contributed Notes 1 note

up
6
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