Explore PHP Standard Library 6.0.0: New Repo, 61 Split Packages & Key Features
The PHP Standard Library 6.0.0 release introduces a new repository, splits the library into 61 independent Composer packages, adds URI/IRI/URL handling, a unified cancellation token system, numerous component upgrades, breaking changes, and bug fixes for developers.
PHP Standard Library 6.0.0
This is the largest release of the PHP Standard Library (PSL) to date, featuring a new repository location, new package structure, and many new functionalities.
New Addresses
Repository : https://github.com/php-standard-library/php-standard-library (formerly azjezz/psl)
Website : https://php-standard-library.dev/ (formerly psl.carthage.software)
Packagist : php-standard-library/php-standard-library (formerly azjezz/psl)
The old azjezz/psl package is deprecated; switch with:
composer require php-standard-library/php-standard-libraryThe namespace remains Psl\.
61 Independent Packages
PSL is now split into 61 installable packages, allowing selective installation.
Only want type‑safe casting? → composer require php-standard-library/type Need an async TCP server? → composer require php-standard-library/tcp Need URI handling? → composer require php-standard-library/uri Each package declares only its required dependencies. To install the full suite:
composer require php-standard-library/php-standard-libraryAll 61 packages are hosted under the php-standard-library GitHub organization, each with a read‑only split repository for Composer.
New Important Components
URI / IRI / URL Handling
URI : RFC 3986 parsing, normalization, reference resolution, RFC 6570 URI Template (levels 1‑4)
IRI : RFC 3987 internationalized identifiers, Unicode, Punycode, IDNA 2008
URL : Strict URL type with scheme/authority validation and automatic default‑port stripping
Punycode
Standalone RFC 3492 Punycode encoder/decoder for internationalized domain names.
New Cancellation Mechanism (Cancellation Tokens)
Replaces the previous Duration $timeout parameter; all async/IO operations now use a unified cancellation token. CancellationTokenInterface – base interface TimeoutCancellationToken – automatic timeout cancellation SignalCancellationToken – manual cancellation LinkedCancellationToken – cancels when any child token cancels
Other Highlights
TaskGroupand WaitGroup – structured concurrency support
QuotedPrintable and EncodedWord encoding (RFC 2045/2047)
Stream‑compatible Base64 / Hex / QuotedPrintable IO handles TLS\Listener – wrap any listener with TLS TCP\RestrictedListener – IP/CIDR based access control Network\CompositeListener – listen on multiple addresses simultaneously
New methods readByte(), readLine(), readUntil() on BufferedReadHandleInterface TCP, Unix, UDP, Socks now use configuration objects instead of parameter arrays
Breaking Changes
Cancellation mechanism replaces timeout parameter:
// 5.x style
$data = $reader->read(timeout: Duration::seconds(5));
// 6.0 style
$data = $reader->read(cancellation: new Async\TimeoutCancellationToken(Duration::seconds(5)));Naming convention unified to camelCase for variables, parameters, and properties.
Configuration objects replace loose parameter lists for TCP\listen(), TCP\connect(), Unix\listen(), UDP\Socket::bind(), Socks\Connector, etc.
Timeout exceptions removed; use Async\Exception\CancelledException instead.
TLS class names changed: TLS\ServerConfig → TLS\ServerConfiguration, TLS\ClientConfig → TLS\ClientConfiguration.
Bug Fixes
RetryConnector back‑off sleep now respects cancellation token.
IO\write(), IO\write_line(), Str\format() no longer crash when a format string contains “%” without parameters.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
