public static function parseIPv4Number($input)
    {
        if ($input === '') {
            $number = 0;
        } elseif (preg_match('/^(?:(?<R16>0x[0-9A-F]*)|(?<R8>0[0-7]+)|(?<R10>0|[1-9][0-9]*))$/ui', $input, $matches) === 1) {
            if ($matches['R16'] !== '') {
                $number = hexdec($input);
            } elseif ($matches['R8'] !== '') {
                $number = octdec($input);
            } else {
                $number = (float)$input > PHP_INT_MAX ? (float)$input : (int)$input;
            }
        } else {
            $number = false;
        }
        return $number;
    }
public static function parseIPv4Number($input)
    {
        if ($input === '') {
            $number = 0;
        } elseif (preg_match('/^(?:(?<R16>0x[0-9A-F]*)|(?<R8>0[0-7]+)|(?<R10>0|[1-9][0-9]*))$/ui', $input, $matches) === 1) {
            if ($matches['R16'] !== '') {
                $number = hexdec($input);
            } elseif ($matches['R8'] !== '') {
                $number = octdec($input);
            } else {
                $number = (float)$input > PHP_INT_MAX ? (float)$input : (int)$input;
            }
        } else {
            $number = false;
        }
        return $number;
    }
public static function parseIPv4Number ( $ input ) { if ( $ input === '' ) { $ number = 0 ; } elseif ( preg_match ( '/^(?:(?<R16>0x[0-9A-F]*)|(?<R8>0[0-7]+)|(?<R10>0|[1-9][0-9]*))$/ui' , $ input , $ matches ) === 1 ) { if ( $ matches [ 'R16' ] !== '' ) { $ number = hexdec ( $ input ) ; } elseif ( $ matches [ 'R8' ] !== '' ) { $ number = octdec ( $ input ) ; } else { $ number = ( float ) $ input > PHP_INT_MAX ? ( float ) $ input : ( int ) $ input ; } } else { $ number = false ; } return $ number ; }
The IPv4 number parser.
@link https://url.spec.whatwg.org/#ipv4-number-parser URL Standard
@param string $input A UTF-8 string.
@return int|float|false
The IPv4 number parser .