コード例 #1
0
ファイル: Arrays.php プロジェクト: intrawarez/sabertooth
 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;
 }