where() публичный Метод

Filter using the given callback function.
public where ( callable $filter ) : array
$filter callable The filter function should be a function with the following signature: ```php function($key, $value) { // returns true if the value is matching your criteria. } ```
Результат array
Пример #1
0
 public function testWhere()
 {
     $data = [];
     $a = new ArrayWrapper(['value1' => 1, 'value2' => 2]);
     $filtered = $a->where(function ($key, $value) {
         return $value > 1;
     });
     $this->assertCount(1, $filtered);
 }