Creates a Closure that returns true when every element of an array or iterable passes the predicate. Short-circuits on the first non-matching value.
/**
* @param callable(mixed):bool $function
* @return Closure(iterable<int|string, mixed>):bool
*/
Arrays\filterAll(callable $function): ClosureWhen Arrays\filterAll() is called, it returns the following Closure which can be used like a regular function.
/**
* @param iterable<int|string, mixed> $source
* @return bool
*/
$function (iterable $source): boolThis can be used to create a simple closure which can be used as a regular function.
$allPositive = Arrays\filterAll(fn($v) => $v > 0);
var_dump($allPositive([1, 2, 3])); // true
var_dump($allPositive([1, -2, 3])); // falseThis can be called inline using currying.
var_dump(Arrays\filterAll('is_int')([1, 2, 'three'])); // false