CachingIterator::getFlags

(PHP 5 >= 5.2.0, PHP 7)

CachingIterator::getFlagsGet flags used

설명

public int CachingIterator::getFlags ( void )
Warning

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

Get the bitmask of the flags used for this CachingIterator instance.

인수

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

반환값

Description...

add a note add a note

User Contributed Notes 2 notes

up
0
Anonymous
9 years ago
use 'CachingIterator::TOSTRING_USE_INNER' flag

<?php
class A extends ArrayIterator {
    public function
__toString(){
        return
'toString this class';
        }
    }

$iterator = new A(array('apple'=>10, 'banana'=>20, 'cat'=>30));
$cache    = new CachingIterator($iterator, CachingIterator::TOSTRING_USE_INNER);

$cache->next();
$cache->next();

echo
$cache;

/*
output:
toString this class

*/
?>
up
0
kais7mg at qq dot com
9 years ago
use the 'CachingIterator::TOSTRING_USE_KEY', when echo this Object,
output current 'key';

<?php
$iterator
= new ArrayIterator(array('apple'=>10, 'banana'=>20, 'cat'=>30));
$cache    = new CachingIterator($iterator, CachingIterator::TOSTRING_USE_KEY);

$cache->next();
$cache->next();

echo
$cache;
?>

output:
banana
To Top