Rust

rfc3986

Module

Uri\Rfc3986\Uri from the PHP 8.5 URI extension.

PHP parses with uriparser 1.0 (uriParseSingleUriExMmA, the RFC 3986 URI-reference grammar), keeps the parsed URI for the getRaw*() getters, and reads the normalized getters (getScheme(), getHost()) from a copy passed through uriNormalizeSyntaxExMmA with every normalization enabled. This module ports the parser state machine (UriParse.c) and the scheme and host normalization (UriNormalize.c, UriCommon.c) byte for byte, including their quirks:

  • host lowercasing stops at a % in the last three bytes of the host;
  • a port longer than 20 digits or above PHP_INT_MAX makes parse() return null (PHP's own check).

The normalized user info, path, port, query and fragment getters, toString()/toRawString(), base URIs (parse($uri, $baseUrl)), resolve() and the with*() modifiers are not ported: no Utopia library uses them.

Contents

use php_std::url::rfc3986::Uri;
Rust
pub struct Uri<'a>

A URI parsed by Uri\Rfc3986\Uri::parse().