Determines the most appropriate int type
@param string $intStr String containing an integer value
333346
public static function parse($intStr){
		
		$int = new static(\strlen($intStr));
		
		if(Number::between($int, MySQL::getConstant('TINYINT_MIN'),
				MySQL::getConstant('TINYINT_MAX'))){
			$int->_IntType = static::TINY_INT;
		}
		else if(Number::between($int, MySQL::getConstant('SMALLINT_MIN'),
				MySQL::getConstant('SMALLINT_MAX'))){
			$int->_IntType = static::SMALL_INT;
		}
		else if(Number::between($int, MySQL::getConstant('MEDIUMINT_MIN'),
				MySQL::getConstant('MEDIUMINT_MAX'))){
			$int->_IntType = static::MEDIUM_INT;
		}
		else if(Number::between($int, MySQL::getConstant('INT_MIN'),
				MySQL::getConstant('INT_MAX'))){
			$int->_IntType = static::INT;
		}
		else if(Number::between($int, MySQL::getConstant('BIGINT_MIN'),
				MySQL::getConstant('BIGINT_MAX'))){
			$int->_IntType = static::BIG_INT;
		}
		else{
			//No types can hold this
			return null;
		}
				
		return $int;
		
	}
7513
public static function mustBeNullableInt($value)
    {
        if (is_int($value) === false && $value != null) {
            throw new MWrongTypeException('\$value', 'int|null', gettype($value));
        }
    }
1143256
protected static function _intlToAscii($str)
    {
        if (class_exists('Transliterator')) {
            if (!isset(self::$_transliterator)) {
                self::$_transliterator = Transliterator::create(
                    'Any-Latin; Latin-ASCII'
                );
            }

            if (!is_null(self::$_transliterator)) {
                /* Returns false on error. */
                return self::$_transliterator->transliterate($str);
            }
        }

        return false;
    }
85017
private function typeCast(&$str)
  {
    if (is_numeric($str)) {
      $cast = intval($str);
      if ($str == (string) $cast) {
        $str = $cast;
      } else {
        $str = floatval($str);
      }
    }
  }
566536
private function validateInteger(string $str) : int
    {
        $ret = filter_var($str,FILTER_VALIDATE_INT);
        if ($ret === false){
            throw new CompileErrorException('invalid integer value', $this->state);
        }
        return $ret;
    }
1226566
protected function _validate_int($value)
    {
        if (is_int($value)) {
            return $value;
        }

        return preg_match('#^[+-]?\d+$#', $value) ? (int)$value : null;
    }
496856
function intmax( type ) {
	if ( !arguments.length ) {
		return TYPES.int32;
	}
	if ( !isString( type ) ) {
		throw new TypeError( 'intmax()::invalid input argument. Must provide an input string primitive. Value: `' + type + '`.' );
	}
	if ( !TYPES.hasOwnProperty( type ) ) {
		throw new Error( 'intmax()::invalid input argument. Unrecognized integer type. Must be one of the following: \"' + Object.keys( TYPES ).join( '\", \"' ) + '\". Value: `' + type + '`.' );
	}
	return TYPES[ type ];
}
577457
protected function detectType($value): int
    {
        switch (gettype($value)) {
            case 'boolean':
                return \PDO::PARAM_BOOL;
            case 'integer':
                return \PDO::PARAM_INT;
            case 'NULL':
                return \PDO::PARAM_NULL;
            default:
                return \PDO::PARAM_STR;
        }
    }
1135346
public static function isInteger($value)
    {
        if (is_int($value)) {
            return true;
        } elseif (!is_string($value)) {
            return false;
        }

        return preg_match('/^\d+$/', $value) > 0;
    }
257927
private function convertInt($value)
    {
        if (!is_numeric($value)) {
            return $value;
        }

        if ((string) (int) $value !== (string) $value) {
            return $value;
        }

        return (int) $value;
    }
1138142
public function writeInt($value)
    {
        // We do not need to check if file position points to the end of "file".
        // Only append operation is supported now

        settype($value, 'integer');
        $this->_data .= chr($value>>24 & 0xFF) .
                        chr($value>>16 & 0xFF) .
                        chr($value>>8  & 0xFF) .
                        chr($value     & 0xFF);

        $this->_position = strlen($this->_data);
    }
802050
public function setInt(string $key, int $value): self
    {
        $this->set($key, intval($value));
        return $this;
    }
1313760
public static function parseString($value) {
        if (null === $value) {
            return null;
        }
        if (0 === preg_match("/^[0-9]{1,}$/", $value)) {
            throw new IntegerArgumentException($value);
        }
        return intval($value);
    }
453324
protected function get_int_value( $value, $default, $setting ) {
		$default = (int) $default;
		if ( is_numeric( $value ) ) {
			$value = (int) $value;
			if ( $value !== $default ) {
				if ( isset( $setting['min'] ) && $value < (int) $setting['min'] ) {
					$value = (int) $setting['min'];
				}
				if ( isset( $setting['max'] ) && $value > (int) $setting['max'] ) {
					$value = (int) $setting['max'];
				}
			} elseif ( isset( $setting['option'] ) ) {
				$default = isset( $setting['option_default'] ) ? (int) $setting['option_default'] : $default;
				$value   = (int) $this->app->get_option( $setting['option'], $default );
			}
		} else {
			$value = $default;
		}

		return $value;
	}
880905
public static Integer strToInt(String _str, Integer _default) {
        if (_str == null) {
            return _default;
        }
        if (TypeUtil.isInteger(_str, true)) {
            return Integer.valueOf(_str);
        } else {
            return _default;
        }
    }
744059
public function intVal(): int
    {
        if (!isset($this->_intNum)) {
            $num = gmp_init($this->_num, 10);
            if (gmp_cmp($num, $this->_intMaxGmp()) > 0) {
                throw new \RuntimeException("Integer overflow.");
            }
            if (gmp_cmp($num, $this->_intMinGmp()) < 0) {
                throw new \RuntimeException("Integer underflow.");
            }
            $this->_intNum = gmp_intval($num);
        }
        return $this->_intNum;
    }
152778
function intval($index = '', $default = 0) {
		$value = $default;
		if (isset($_POST[$index])) {
			$value = $_POST[$index];
		} else if (isset($_GET[$index])) {
			$value = $_GET[$index];
		}
		return intval($value);
	}