Documentation

FilterIterator extends FilterIterator
in package

Filters values using a callback

Used when PHP 5.4's CallbackFilterIterator is not available

Table of Contents

$callback  : mixed
__construct()  : mixed
accept()  : mixed

Properties

Methods

__construct()

public __construct(Iterator $iterator, array<string|int, mixed>|Closure $callback) : mixed
Parameters
$iterator : Iterator

Traversable iterator

$callback : array<string|int, mixed>|Closure

Callback used for filtering. Return true to keep or false to filter.

Tags
throws
InvalidArgumentException

if the callback if not callable

Return values
mixed

Search results