azjezz/psl
PSL is a modern, well-typed standard library for PHP 8.4+, inspired by HHVM’s HSL. It offers safer, predictable APIs for async, collections, networking, I/O, crypto, terminal UI, and robust data validation—replacing brittle built-ins with consistent alternatives.
The IRI component provides RFC 3987 compliant Internationalized Resource Identifier parsing with full Unicode support, Punycode encoding/decoding, and IDNA 2008 domain name processing.
Parse IRI strings containing Unicode characters:
@example('networking/iri-parsing.php')
Input is NFC-normalized and validated against RFC 3987 character ranges. Private-use characters are only permitted in the query component.
Convert an IRI to an ASCII-only RFC 3986 URI. International domain names are Punycode-encoded and Unicode path/query/fragment characters are percent-encoded:
@example('networking/iri-to-uri.php')
Reverse the process - decode a URI back to an IRI with Unicode characters restored:
@example('networking/iri-from-uri.php')
| RFC | Title |
|---|---|
| RFC 3987 | Internationalized Resource Identifiers (IRIs) |
| RFC 3492 | Punycode: Bootstring Encoding for IDNA |
| RFC 5891 | IDNA 2008: Protocol |
| RFC 5892 | IDNA 2008: Unicode Code Points |
See src/Psl/IRI/ for the full API.
How can I help you explore Laravel packages today?