public static function all($array, $predicate) { foreach ($array as $key => $item) { if (!$predicate($item, $key)) { return false; } } return true; }