public function reduce(callable $fn, $initial = 0)
    {
        if (!is_int($initial) and !is_float($initial)) {
            throw new InvalidArgumentException('Initial value must'
                . ' be an integer or float, ' . gettype($initial)
                . ' found.');
        }

        return array_reduce($this->a, $fn, $initial);
    }
public function reduce(callable $fn, $initial = 0)
    {
        if (!is_int($initial) and !is_float($initial)) {
            throw new InvalidArgumentException('Initial value must'
                . ' be an integer or float, ' . gettype($initial)
                . ' found.');
        }

        return array_reduce($this->a, $fn, $initial);
    }
public function reduce ( callable $ fn , $ initial = 0 ) { if ( ! is_int ( $ initial ) and ! is_float ( $ initial ) ) { throw new InvalidArgumentException ( 'Initial value must' . ' be an integer or float, ' . gettype ( $ initial ) . ' found.' ) ; } return array_reduce ( $ this -> a , $ fn , $ initial ) ; }
Reduce the vector down to a scalar.

@param callable $fn
@param mixed $initial
@throws \InvalidArgumentException
@return mixed
Reduce the vector down to a scalar .