mensbeam/uri
Composer 安装命令:
composer require mensbeam/uri
包简介
An implementation of the PHP URI extension for older PHP versions
README 文档
README
A polyfill for the PHP URI extension introduced in PHP 8.5. All features as of PHP 8.5.8 are replicated.
Features
- Compatibility back to PHP 7.1
- Passes all
urltestdata.jsonWeb Platform tests - Passes most PHP tests (see Differences below)
- Requires no PHP extensions
Differences
- The
Uri\Rfc3986\UriandUri\WhatWg\Urlclasses are neither final nor read-only Uri\Rfc3986\UriandUri\WhatWg\Urlobject serialization differ and are subject to change- Performing
var_export()onUri\Rfc3986\UriandUri\WhatWg\Urlobjects will yield different results - Casting
Uri\Rfc3986\UriandUri\WhatWg\Urlto array will yield different results - When using PHP 8.0 or earlier
Uri\UriComparisonModeandUri\WhatWg\UrlValidationErrorTypeare classes with a series of string constants rather than enumerations. - Where the enumerations
Uri\UriComparisonModeandUri\WhatWg\UrlValidationErrorTypeare used as parameter types, their types are not enforced - The result of converting an internationalized domain name to ASCII may differ
- The following PHP bugs are preemptively fixed:
- GH-22608: ext/uri: RFC 3986 initial-double-dot path can yield incorrect normalization
- GH-22618: ext/uri: RFC 3986 IPv6 handling is inconsistent
- GH-22628: ext/uri: Percent-encoding of caret in WHATWG URL paths is not performed
- GH-22629: ext/uri: WHATWG Validation error incorrect with empty host and non-empty userinfo
Availability
The polyfill is available on Packagist as mensbeam/uri, with source code available on my personal repository and mirrored on Codeberg.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-07