PHPackages                             league/uri-polyfill - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. league/uri-polyfill

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

league/uri-polyfill
===================

Polyfill backporting PHP 8.5+ native RFC3986/WHATWG URI features to lower PHP versions

7.8.1(2mo ago)06.2k↓16.7%1MITPHPPHP &gt;=8.1CI passing

Since Nov 18Pushed 2mo agoCompare

[ Source](https://github.com/thephpleague/uri-polyfill)[ Packagist](https://packagist.org/packages/league/uri-polyfill)[ GitHub Sponsors](https://github.com/nyamsprod)[ RSS](/packages/league-uri-polyfill/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (1)

URI parsing polyfill for PHP8.1+
================================

[](#uri-parsing-polyfill-for-php81)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/72e4fdfa9a2f34ec3b86bd9cddc123b4cff223b4d91c034119f074e8e6158e8d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f7572692d706f6c7966696c6c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/uri-interfaces/releases)[![Total Downloads](https://camo.githubusercontent.com/37e619db5aed91e02cc9696bf861951ee7dcb50b766e39da7695fbd2a62fb1da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f7572692d706f6c7966696c6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/uri-interfaces)

```
$uri = new Uri\Rfc3986\Uri("HTTPS://ex%61mpLE.com:443/foo/../bar/./baz?#fragment");
$uri->toRawString(); // returns "HTTPS://ex%61mpLE.com:443/foo/../bar/./baz?#fragment"
$uri->toString();    // returns "https://example.com:443/bar/baz?#fragment"

$url = new Uri\WhatWg\Url("HTTPS://🐘.com:443/foo/../bar/./baz?#fragment");
echo $url->toAsciiString();   // returns "https://xn--go8h.com/bar/baz?#fragment"
echo $url->toUnicodeString(); // returns "https://🐘.com/bar/baz?#fragment"
```

This package provides a polyfill for the new native PHP URI parsing features to be included in **PHP8.5**. The polyfill works for PHP versions greater or equal to **PHP8.1**

> ⚠️ this is a sub-split, for development, pull requests and issues, visit:

System Requirements
-------------------

[](#system-requirements)

To use the package, you require:

- **PHP &gt;= 8.1** but the latest stable version of PHP is recommended
- [league/uri-interfaces](https://github.com/thephpleague/uri-interfaces)
- [rowbot/url](https://github.com/TRowbotham/URL-Parser)

Tip

If you are using **PHP 8.1**, you **SHOULD** install `symfony/polyfill-php82` to use its `SensitiveParameter` polyfill

Install
-------

[](#install)

Install the package using Composer.

```
composer require league/uri-polyfill:^7.6
```

Documentation
-------------

[](#documentation)

The RFC introduces:

- the `Uri\Rfc3986\Uri` class, an [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) compliant URI parser
- the `Uri\WhatWg\Url` class, an [WHATWG](https://url.spec.whatwg.org/) compliant URL parser

Full documentation can be found on the [Add RFC 3986 and WHATWG compliant URI parsing support RFC](https://wiki.php.net/rfc/url_parsing_api).

Contributing
============

[](#contributing)

Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Ignace Nyamagana Butera](https://github.com/nyamsprod)
- [All Contributors](https://github.com/bakame-php/aide-uri/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](../uri-src/polyfill/LICENSE) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance87

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Total

4

Last Release

64d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51073?v=4)[Ignace Nyamagana Butera](/maintainers/nyamsprod)[@nyamsprod](https://github.com/nyamsprod)

---

Top Contributors

[![nyamsprod](https://avatars.githubusercontent.com/u/51073?v=4)](https://github.com/nyamsprod "nyamsprod (38 commits)")[![Simbiat](https://avatars.githubusercontent.com/u/6022665?v=4)](https://github.com/Simbiat "Simbiat (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")

---

Tags

phppolyfillrfc3986whatwg-urlportablepolyfillurlurirfc3986parserresolverWHATWGequivalencecompatibiliy

### Embed Badge

![Health badge](/badges/league-uri-polyfill/health.svg)

```
[![Health](https://phpackages.com/badges/league-uri-polyfill/health.svg)](https://phpackages.com/packages/league-uri-polyfill)
```

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[symfony/polyfill-ctype

Symfony polyfill for ctype functions

4.0k982.0M125](/packages/symfony-polyfill-ctype)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.7k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)[symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

2.4k581.8M67](/packages/symfony-polyfill-php73)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
