public static function bound($number, $min = 0, $max = PHP_INT_MAX)
    {
        $number = (int)$number;
        $min = (int)$min;
        $max = (int)$max;

        return min(max($number, $min), $max);
    }
public static function bound($number, $min = 0, $max = PHP_INT_MAX)
    {
        $number = (int)$number;
        $min = (int)$min;
        $max = (int)$max;

        return min(max($number, $min), $max);
    }
public static function bound ( $ number , $ min = 0 , $ max = PHP_INT_MAX ) { $ number = ( int ) $ number ; $ min = ( int ) $ min ; $ max = ( int ) $ max ; return min ( max ( $ number , $ min ) , $ max ) ; }
Returns an integer within a boundary.

@param int $number
@param int $min
@param int $max

@return int
Returns an integer within a boundary .