|
The CallbackFilterIterator classIntroduction
Class synopsis
CallbackFilterIterator
extends
FilterIterator
/* Methods */
public CallbackFilterIterator::__construct(Iterator
$iterator , callable $callback )public bool CallbackFilterIterator::accept()
/* Inherited methods */
public bool accept()
public mixed current()
public mixed key()
public void next()
public void rewind()
public bool valid()
public mixed IteratorIterator::current()
public Iteratornull IteratorIterator::getInnerIterator()
public mixed IteratorIterator::key()
public void IteratorIterator::next()
public void IteratorIterator::rewind()
public bool IteratorIterator::valid()
ExamplesThe callback should accept up to three arguments: the current item, the current key and the iterator, respectively. Example #1 Available callback arguments
Any callable may be used; such as a string containing a function name, an array for a method, or an anonymous function. Example #2 Callback basic examples
|