Example #1
0
 public function testEvery()
 {
     $arr = array(3, 2, 1);
     $r = PHPArray::every($arr, function ($item) {
         return $item <= 3;
     });
     $this->assertTrue($r);
 }
Example #2
0
 /**
  * Tests whether every item meets a given condition
  * @param \Closure $predicate
  * @return bool
  */
 public function every(\Closure $predicate)
 {
     return PHPArray::every($this->_Arr, $predicate);
 }