CallbackFilterIterator
Extends \FilterIteratorCallbackFilterIterator using the callback to determine which items are accepted or rejected.
link | |
---|---|
since |
1.2.0 |
Methods
__construct
Creates a filtered iterator using the callback to determine which items are accepted or rejected.
__construct(\Iterator $iterator, callable $callback)
throws |
|
---|---|
since |
1.2.0 |
Arguments
- $iterator
\Iterator
The iterator to be filtered.- $callback
callable
The callback, which should return TRUE to accept the current item or FALSE otherwise. May be any valid callable value. The callback should accept up to three arguments: the current item, the current key and the iterator, respectively.function my_callback($current, $key, $iterator)
accept
This method calls the callback with the current value, current key and the inner iterator.
accept() : boolean
The callback is expected to return TRUE if the current item is to be accepted, or FALSE otherwise.
link |
http://www.php.net/manual/en/callbackfilteriterator.accept.php |
---|---|
since |
1.2.0 |
Response
boolean
True if the current element is acceptable, otherwise false.
Properties
callback
The callback to check value.
since |
1.2.0 |
---|
Type(s)
callable