NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class FilterIterator

Filters values using a callback

Used when PHP 5.4's \CallbackFilterIterator is not available

  IteratorIterator implements Iterator, Traversable, OuterIterator
  FilterIterator
  Guzzle\Iterator\FilterIterator

Namespace: Guzzle\Iterator
Located at Guzzle/Iterator/FilterIterator.php

## Methods summary

- `public` `__construct ( Iterator $iterator, array|\Closure $callback )`
- `public` `accept ( )`

## Methods detail

# `public`
`__construct( `Iterator` $iterator, array|`Closure` $callback )`

#### Parameters

$iterator
  ``Iterator``
  $iterator Traversable iterator
$callback
  `array|`Closure``
  $callback Callback used for filtering. Return true to keep or false to filter.

#### Throws

``Guzzle\Common\Exception\InvalidArgumentException``
if the callback if not callable

#### Overrides

`FilterIterator::__construct`
# `public`
`accept( )`

### Methods inherited from FilterIterator

`current()`, `getInnerIterator()`, `key()`, `next()`, `rewind()`, `valid()`

### Magic methods summary

## Properties summary

`protected mixed` | $callback | # Callback used for filtering