public static function toRoman($int)
    {
        if (!is_int($int) || $int < 1 || $int > 3999) {
            throw new \InvalidArgumentException("A roman numeral must be an integer between 1 and 3999, $int given.");
        }

        $roman = '';
        foreach (self::$characters as $number => $character) {
            while ($int >= $number) {
                $roman .= $character;
                $int -= $number;
            }
        }

        return $roman;
    }
public static function toRoman($int)
    {
        if (!is_int($int) || $int < 1 || $int > 3999) {
            throw new \InvalidArgumentException("A roman numeral must be an integer between 1 and 3999, $int given.");
        }

        $roman = '';
        foreach (self::$characters as $number => $character) {
            while ($int >= $number) {
                $roman .= $character;
                $int -= $number;
            }
        }

        return $roman;
    }
public static function toRoman ( $ int ) { if ( ! is_int ( $ int ) || $ int < 1 || $ int > 3999 ) { throw new \ InvalidArgumentException ( "A roman numeral must be an integer between 1 and 3999, $int given." ) ; } $ roman = '' ; foreach ( self :: $ characters as $ number => $ character ) { while ( $ int >= $ number ) { $ roman .= $ character ; $ int -= $ number ; } } return $ roman ; }
Convert an integer to a roman numeral.

@param int $int

@return string
Convert an integer to a roman numeral .