PHPKonf İstanbul PHP Conference 2015

CachingIterator::getFlags

(PHP 5 >= 5.2.0)

CachingIterator::getFlagsدریافت پرچم‌های استفاده شده

Description

public void CachingIterator::getFlags ( void )
Warning

This function is currently not documented; only its argument list is available.

دریافت bitmask پرچم‌های استفاده شده برای نمونه CachingIterator.

Parameters

This function has no parameters.

Return Values

Description...

add a note add a note

User Contributed Notes 2 notes

up
0
Anonymous
5 months 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
5 months 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