示例#1
0
 public static final function some(array $array, PredicateInterface $predicate) : bool
 {
     foreach ($array as $key => $value) {
         if ($predicate->call($value, $key)) {
             return true;
         }
     }
     return false;
 }
示例#2
0
 public static final function some(\Traversable $traversable, PredicateInterface $predicate) : bool
 {
     foreach ($traversable as $key => $value) {
         if ($predicate->call($value, $key)) {
             return true;
         }
     }
     return false;
 }