public function some(array $array, callable $callback): bool
    {
        foreach ($array as $key => $value) {
            if ($callback($value, $key)) {
                return true;
            }
        }
        return false;
    }
public function some(array $array, callable $callback): bool
    {
        foreach ($array as $key => $value) {
            if ($callback($value, $key)) {
                return true;
            }
        }
        return false;
    }
public function some ( array $ array , callable $ callback ) : bool { foreach ( $ array as $ key => $ value ) { if ( $ callback ( $ value , $ key ) ) { return true ; } } return false ; }
Check if at least one element in an array passes a test given by the calback,
passing each element and key as arguments

Example::

Array.some([1, 2, 3, 4], x => x % 2 == 0) // == true
Array.some([1, 2, 3, 4], x => x > 4) // == false

@param array $array Array of elements to test
@param callable $callback Callback for testing elements, current value and key will be passed as arguments
@return bool True if at least one element passed the test
Check if at least one element in an array passes a test given by the calback passing each element and key as arguments