src/Money.php
public static function total(Money $money, Money ...$monies) : Money
    {
        $total = $money;

        foreach ($monies as $money) {
            $total = $total->plus($money);
        }

        return $total;
    }
public static function total(Money $money, Money ...$monies) : Money
    {
        $total = $money;

        foreach ($monies as $money) {
            $total = $total->plus($money);
        }

        return $total;
    }
public static function total ( Money $ money , Money ... $ monies ) : Money { $ total = $ money ; foreach ( $ monies as $ money ) { $ total = $ total -> plus ( $ money ) ; } return $ total ; }
Returns the total of the given monies.

The monies must share the same currency and context.

@param Money    $money  The first money.
@param Money ...$monies The subsequent monies.

@return Money

@throws MoneyMismatchException If all the monies are not in the same currency and context.
Returns the total of the given monies .