public function every(array $array, callable $callback): bool
    {
        foreach ($array as $key => $value) {
            if (!$callback($value, $key)) {
                return false;
            }
        }
        return true;
    }
public function every(array $array, callable $callback): bool
    {
        foreach ($array as $key => $value) {
            if (!$callback($value, $key)) {
                return false;
            }
        }
        return true;
    }
public function every ( array $ array , callable $ callback ) : bool { foreach ( $ array as $ key => $ value ) { if ( ! $ callback ( $ value , $ key ) ) { return false ; } } return true ; }
Check if all elements in an array pass a test given by the calback,
passing each element and key as arguments

Example::

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

@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 all elements passed the test
Check if all elements in an array pass a test given by the calback passing each element and key as arguments