public function where(callable $filter)
    {
        $filtered = [];

        foreach ($this->array as $key => $value) {
            if ($filter($key, $value) === true) {
                $filtered[$key] = $value;
            }
        }

        return $filtered;
    }
public function where(callable $filter)
    {
        $filtered = [];

        foreach ($this->array as $key => $value) {
            if ($filter($key, $value) === true) {
                $filtered[$key] = $value;
            }
        }

        return $filtered;
    }
public function where ( callable $ filter ) { $ filtered = [ ] ; foreach ( $ this -> array as $ key => $ value ) { if ( $ filter ( $ key , $ value ) === true ) { $ filtered [ $ key ] = $ value ; } } return $ filtered ; }
Filter using the given callback function.

@param callable $filter The filter function should be a function with the
following signature:

```php
function($key, $value)
{
// returns true if the value is matching your criteria.
}
```

@return array
Filter using the given callback function .