Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. sabre/uri

sabre/uri

BSD-3-ClausePHP3.1.0

A lightweight PHP library for RFC3986-compliant URI parsing, building, resolving, and normalizing.

Visit WebsiteGitHubGitHub
297 stars24 forks0 contributors

What is sabre/uri?

sabre/uri is a PHP library that provides functions for parsing, building, resolving, and normalizing URIs according to the RFC3986 standard. It solves common problems when working with URIs in PHP applications, offering reliable utilities that handle edge cases like Windows-style paths.

Target Audience

PHP developers who need robust URI manipulation in web applications, APIs, or any system dealing with URL parsing and resolution.

Value Proposition

Developers choose sabre/uri for its strict RFC3986 compliance, comprehensive test coverage, and reliable handling of special cases that PHP's built-in functions don't address properly.

Overview

:earth_asia: Functions for making sense out of URIs in PHP

Use Cases

Best For

  • Resolving relative URLs against a base URI in web applications
  • Normalizing URIs for comparison or deduplication tasks
  • Parsing URIs with special handling for Windows file paths
  • Building URIs from components in API or routing systems
  • Safely extracting directory and filename parts from URLs
  • Ensuring RFC3986 compliance in URI-related operations

Not Ideal For

  • Projects that only need basic URL parsing without strict RFC compliance
  • Applications requiring full HTTP client capabilities like requests or cookies
  • Teams using modern PHP frameworks with built-in URI utilities (e.g., Laravel or Symfony)
  • Environments with strict dependency minimization preferring built-in PHP functions

Pros & Cons

Pros

RFC3986 Compliance

All functions strictly adhere to the RFC3986 specification, with 100% unit test coverage based on official examples, ensuring correct handling of edge cases as highlighted in the README.

Reliable URI Resolution

The resolve function accurately converts relative URLs to absolute URIs using a base URI, solving real-world problems in PHP applications, as mentioned in the library's value proposition.

Enhanced Parsing Support

Parse function improves upon PHP's parse_url by correctly handling Windows-style paths, addressing a known limitation, with details referenced in the README's pull request link.

High Test Coverage

With 100% unit tests and a clear release history supporting multiple PHP versions, the library is reliable and well-maintained, as evidenced by the build status and version table.

Cons

External Documentation Dependency

Usage and installation guides are hosted on an external website (sabre.io), which can be inconvenient and might lead to accessibility issues if the site is down or outdated.

Narrow Feature Scope

Focused solely on RFC3986 URI manipulation, it lacks broader URL-related features like validation, encoding, or HTTP integration, requiring additional libraries for comprehensive web tasks.

PHP Version Constraints

Latest versions require PHP 7.4 or higher, which may force upgrades in legacy systems or limit adoption in environments with older PHP installations, as shown in the release table.

Frequently Asked Questions

Quick Stats

Stars297
Forks24
Contributors0
Open Issues3
Last commit4 days ago
CreatedSince 2014

Tags

#uri-parsing#php-library#url-manipulation#url#normalization#path-resolution#api-tooling#rfc3986#uri#php#web-development

Built With

P
PHP

Links & Resources

Website

Included in

PHP32.5k
Auto-fetched 9 hours ago

Related Projects

PHP Domain ParserPHP Domain Parser

Public Suffix List based domain parsing implemented in PHP

Stars1,240
Forks126
Last commit7 months ago
UriUri

[READ-ONLY] URI manipulation Library

Stars1,128
Forks70
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub