/** * Whether any item passes a predicate function * @param \Closure $predicate * @return bool */ public function some(\Closure $predicate) { return PHPArray::some($this->_Arr, $predicate); }
public function testSome() { $arr = array(3, 2, 1); $r = PHPArray::some($arr, function ($item) { return $item >= 2; }); $this->assertTrue($r); }