src/LocalDateTime.php
public static function minOf(LocalDateTime ...$times) : LocalDateTime
    {
        if (! $times) {
            throw new DateTimeException(__METHOD__ . ' does not accept less than 1 parameter.');
        }

        $min = LocalDateTime::max();

        foreach ($times as $time) {
            if ($time->isBefore($min)) {
                $min = $time;
            }
        }

        return $min;
    }
public static function minOf(LocalDateTime ...$times) : LocalDateTime
    {
        if (! $times) {
            throw new DateTimeException(__METHOD__ . ' does not accept less than 1 parameter.');
        }

        $min = LocalDateTime::max();

        foreach ($times as $time) {
            if ($time->isBefore($min)) {
                $min = $time;
            }
        }

        return $min;
    }
public static function minOf ( LocalDateTime ... $ times ) : LocalDateTime { if ( ! $ times ) { throw new DateTimeException ( __METHOD__ . ' does not accept less than 1 parameter.' ) ; } $ min = LocalDateTime :: max ( ) ; foreach ( $ times as $ time ) { if ( $ time -> isBefore ( $ min ) ) { $ min = $ time ; } } return $ min ; }
Returns the smallest LocalDateTime among the given values.

@param LocalDateTime[] $times The LocalDateTime objects to compare.

@return LocalDateTime The earliest LocalDateTime object.

@throws DateTimeException If the array is empty.
Returns the smallest LocalDateTime among the given values .