NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1359 most downloaded on Packagist
PHP Standard Library
Latest stable
6.4.2
Last release 25 days ago
28 Oct 2026
Release timing varies
gaps range from 8 days to 7 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
78 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
This release fixes two Windows bugs that made a failed TLS handshake, and a peek on a reset TCP connection, spin at full CPU until cancelled instead o
This release fixes two Windows bugs that made a failed TLS handshake, and a peek on a reset TCP connection, spin at full CPU until cancelled instead of failing. Upgrading is recommended if you make or accept TLS connections, or peek TCP connections, on Windows.
TLS: On Windows, a client or server handshake now fails with TLS\Exception\HandshakeFailedException when one of its steps fails, for example because the peer closed or reset the connection. PHP on Windows reports such a step as still in progress, because it tells a waiting step from a failed one by an errno that Winsock never resets, so the handshake retried the socket at full CPU until its cancellation token ended it: forever with the default token, and for 10 seconds per connection with the default TLS\Listener deadline. HTTP\Client and SMTP make their TLS connections through TLS\Connector, so they are fixed too. (by @azjezz)TCP: On Windows, a peek on a connection that the peer has reset now throws IO\Exception\RuntimeException instead of spinning at full CPU until its cancellation token ends it. Such a connection stays readable while every peek fails, and it keeps its peer's name, so it did not look failed and the peek waited for it again. (by @azjezz)Install: composer require php-standard-library/php-standard-library:^6.4.2
Full Changelog: 6.4.1...6.4.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
TLS\Listener); PHP on Windows reports such a step as still in progress, because it tells a step that waits from one that failed by an errno that Winsock never resetsThis release fixes two HTTP/2 regressions introduced in 6.4.0. Upgrading is strongly recommended if you use HTTP\Client or the H2 component.
This release fixes two HTTP/2 regressions introduced in 6.4.0. Upgrading is strongly recommended if you use HTTP\Client or the H2 component.
H2 and HTTP\Client: HTTP/2 connections over TLS no longer fail with "HTTP/2 connection is closed." A TLS read returns nothing for records that carry no application data, such as TLS 1.3 session tickets, and for a record that has only partly arrived; since 6.4.0 such a read closed the connection, so requests to servers such as api.github.com, and large responses from any server, failed. The connection now closes only at the end of the data. (by @azjezz)H2\ClientConnection and H2\ServerConnection: Read the bytes that the IO\Reader passed to them has already buffered, such as the first HTTP/2 bytes after an upgrade from HTTP/1.1, before reading the transport. Since 6.4.0 those bytes were skipped. (by @azjezz)http-client now requires ^6.4.1 of h2, so updating http-client also brings in these fixes.Install: composer require php-standard-library/php-standard-library:^6.4.1
Full Changelog: 6.4.0...6.4.1
ConnectionException ("HTTP/2 connection is closed."), so HTTP\Client requests to servers such as api.github.com, and large responses from any server, failedIO\Reader given to ClientConnection or ServerConnection has already buffered, such as the first HTTP/2 bytes after an upgrade from HTTP/1.1, before reading the transport; since 6.4.0 they were skipped^6.4.1 of h2, so updating http-client also brings in the HTTP/2 fixes aboveThis release fixes 12 security vulnerabilities, adds Vec\intersect() , supports PHP 8.6, and fixes more than 240 bugs across the library. Upgrading is…
This release fixes 12 security vulnerabilities, adds Vec\intersect(), supports PHP 8.6, and fixes more than 240 bugs across the library. Upgrading is strongly recommended.
DNSSEC: SecureResolver and TrustChainResolver validate every answer, alias, delegation and denial-proof RRset against the keys of its own zone, so forged or unsigned DNS data no longer passes as validated. (GHSA-pqp4-hj5q-h473)MIME\SMIME\Verifier: Verifies the signer certificate against explicit trust anchors, checking its chain, validity, purpose and CA constraints, so a signature made with an unknown self-signed certificate no longer verifies. An empty trust list now fails verification. (GHSA-7h2c-65cx-p93w)TCP and TLS: Connections accepted on one listener no longer share TLS context state, which could report another client's certificate or apply the client certificate trust settings of an earlier configuration. With ext-sockets, which tcp now suggests, each accepted connection gets its own context. (GHSA-3vrh-x3c6-5h36)TLS\Listener: Runs handshakes concurrently, each with its own deadline (10 seconds by default, $handshakeTimeout), up to $maxPendingHandshakes (256 by default) at a time, so a client that connects and sends nothing can no longer block the listener. (GHSA-7fr9-xww6-mfp3)HTTP\Client: Keys pooled connections by their TLS, SNI, proxy, SOCKS, Unix socket and protocol settings as well as the origin, so a request no longer reuses a connection opened with different TLS or proxy settings. (GHSA-6q49-9m5c-9xgg)HTTP\Client SSRF preset: DeniedDestinationsMiddleware::forPrivateNetworkRanges() now covers the special-purpose ranges it missed, such as 100.64.0.0/10, and matches IPv4-mapped IPv6 peers. (GHSA-xpwf-27h9-7jjj)Message and MIME header injection: Constructed header fields, mailboxes, message ids and MIME parameters reject CR, LF and NUL, and MultiPart\Form percent-encodes them in field names. (GHSA-j84h-7gw3-w75x)Message Bcc disclosure: serialize() no longer writes the Bcc and Resent-Bcc fields, which exposed blind recipients to every recipient. (GHSA-rj6q-j8xp-7532)H2 denial of service: Checks every frame against SETTINGS_MAX_FRAME_SIZE before reading its payload, bounds received header blocks and decoded field sections by default (64 KiB), and gives every connection its own rate limiter state. (GHSA-37xv-5qfq-7qxc)MIME multipart denial of service: Skips the preamble in constant memory and bounds each part header section ($maxHeaderSize, 16 KiB by default). (GHSA-h47r-xw6c-xwwm)Filesystem\create_temporary_file(): Creates files exclusively and with 0600 permissions, so other local users can no longer read or plant them. (GHSA-q8cp-xq93-r9jr)SMTP: Refuses to send with requireTls unless the connection uses TLS and the server advertises REQUIRETLS, instead of silently sending without it. (GHSA-gmcv-xvgq-xjqg)Further hardening without an advisory:
DNS: Rejects a response whose question does not match the query, and checks the UDP transaction ID before parsing any record.HTTP\Client: Validates requests before writing them, hardens and bounds HTTP/1 response parsing, and enforces maxResponseBodySize on HTTP/2 responses.H2: Rejects received field names and values with invalid characters.TCP\SocketPool: Tracks checked-out connections by object instead of by reusable object ID, so a connection can no longer be pooled under another peer's host and port.Vec\intersect(): Returns the values of the first iterable that are present in every other iterable, as a list. Values are compared by their string representation, like Dict\intersect(). (by @shadowhand in #812)use Psl\Vec;
Vec\intersect([1, 2, 3, 4], [2, 4, 6], [4, 2]); // [2, 4]This release contains more than 240 bug fixes. The highlights are below; CHANGELOG.md lists every one.
H2 and HPACK: A stream error resets only the affected stream instead of closing the connection. Flow control counts DATA padding, outbound DATA respects the peer's maximum frame size, SETTINGS apply in wire order, and local settings changes take effect once acknowledged. HPACK tables stay within the negotiated limits.HTTP\Client: HTTP/2 requests are retried only when that is safe. Redirects rewind or resend bodies correctly and resolve Location with RFC 3986 rules. HTTP/2 concurrency respects the server's stream limit, cancellation is honoured at every wait, the 100 Continue wait is bounded ($expectContinueTimeout), and the RetryClient backoff is clamped.IO: Large writes run in linear time. Stream handles make one native read per call and report a connection reset as an error instead of a clean end of data. Reader keeps its buffered bytes at the end of the data and when a read is interrupted or cancelled, and unreferenced stream handles are closed.DateTime: FormatPattern::UnixTimestamp, JulianDay, Http and Cookie produce correct values, and parsing keeps milliseconds. Date fields use the Gregorian calendar whatever the default locale, day, week and month arithmetic is safe across DST changes, and timezone aliases resolve instead of falling back to UTC.Async: Semaphore and KeyedSemaphore never run more operations than their limit, and admit them first in, first out. all(), any() and first() accept generators, and cancellation tokens call every subscribed callback even when one throws.TLS, TCP, Network, UDP and Unix: A short TLS write no longer corrupts the byte stream, and peer fingerprints are checked after the handshake. A failed asynchronous connect throws, IPv6 hosts are stored without brackets, every networking wait settles exactly once, and unreferenced listeners and streams are closed.DNS and DNSSEC: CachedResolver honours record lifetimes and caches failures briefly, as RFC 9520 requires. UDPResolver supports IPv6 nameservers, FallbackResolver stops at NXDOMAIN, and both IANA root keys, KSK-2017 and KSK-2024, are trusted (by @loganaden in #809).MIME and Message: Signatures made by DKIM\Signer now verify. Multipart boundaries are only recognized at the start of a line, and maxParts is enforced as soon as another part starts.SMTP: Checks SMTPUTF8 support before sending non-ASCII addresses or headers, encodes non-ASCII domains as A-labels, throws ConnectionException instead of leaking IO exceptions, and passes the cancellation token to STARTTLS.Encoding: The streaming Base64, Hex and QuotedPrintable handles produce exactly what their one-shot functions do, and RFC 2047 encoded words are split and decoded correctly.Type\class_string(): Accepts interface names when no class is given. (by @shadowhand in #813)Vec\unique_scalar() and Dict\unique_scalar(): Compare values by strict identity, so 1, '1', 1.0 and true are distinct.Ansi, Cache, Channel, CIDR, Collection, Compression, Crypto, Dict, Env, File, Filesystem, Graph, HTML, IP, Iter, Math, Password, Process, Range, SOCKS, Str, Terminal and URI.Str\metaphone(): Deprecated, because the underlying PHP function is deprecated as of PHP 8.6. Use a userland phonetic matching library instead. (by @simPod in #811)^6.4 of the PSL packages it depends on that changed in this release, so updating any package also brings in the bug and security fixes of its PSL dependencies.HTTP\Client: The first requests to some HTTP/2 servers, such as api.github.com, can fail with "HTTP/2 connection is closed." A fix will follow in 6.4.1.Install: composer require php-standard-library/php-standard-library:^6.4
Full Changelog: 6.3.0...6.4.0
UDPResolver or TCPResolver response to match the query's name, type and class (ignoring case), and check the UDP transaction ID before parsing any record, so an answer to a different query is rejected with ProtocolException instead of being accepted; a mismatched TCP reply also closes the pooled connectionStaticTrustChainResolver must now be owned by the zone name.DNS\Record\DNAMERecord and RecordType::DNAME let DNAME substitutions be verified.0600 permissions in create_temporary_file(), retrying on name collisions, so a file created by someone else between choosing the name and creating it can no longer be reusedSETTINGS_MAX_FRAME_SIZE as soon as its 9-byte header arrives and close with FRAME_SIZE_ERROR before reading the payload, so a peer can no longer make a connection buffer an oversized framePROTOCOL_ERROR; validation runs after the whole HPACK block is decoded, so compression state stays in syncClientConnection and ServerConnection its own rate limiter state, so one abusive peer can no longer push the other connections built from the same configuration over their limits and get them closedConfiguration, ServerConfiguration and ClientConfiguration now default maxHeaderBlockSize to the new DEFAULT_MAX_HEADER_BLOCK_SIZE (64 KiB) instead of unlimited, so a peer that never ends a HEADERS or PUSH_PROMISE block with END_HEADERS can no longer make a default ServerConnection or ClientConnection buffer CONTINUATION fragments without bound; the fragment that would exceed the limit closes the connection with PROTOCOL_ERROR before it is buffered, and 0 still lifts the limit. Without a configured SETTINGS_MAX_HEADER_LIST_SIZE, the HPACK decoder now also limits a decoded field section to the new DEFAULT_MAX_RECEIVED_HEADER_LIST_SIZE (64 KiB), without advertising it, instead of accepting any size; a block that decodes to more fails with COMPRESSION_ERROR, and passing DEFAULT_MAX_HEADER_LIST_SIZE as the setting lifts that limitHost single, Content-Length must match the streamed body and framing must not conflict, or RequestException is thrown. An HTTP/1.0 request with a body now needs a Content-Length and can no longer use Transfer-Encoding, and trailers under Content-Length framing are rejected instead of silently dropped.maxResponseHeaderSize, interim responses at 16 and CONNECT response headers at 8192 bytes, and never reuse a connection after a response that combines Transfer-Encoding with Content-Length, is close-delimited, carries close in any Connection field, or uses Transfer-Encoding over HTTP/1.0maxResponseBodySize on HTTP/2 responses as DATA arrives, resetting the stream with CANCEL instead of buffering past the limit, with 0 meaning unlimited as on HTTP/1, reject a malformed :status as a stream error, and cap interim responses at 16 per streamDeniedDestinationsMiddleware::forPrivateNetworkRanges() preset with the special-purpose ranges it missed (current network, shared, IETF protocol assignments, benchmarking, IPv4 and IPv6 multicast, 240.0.0.0/4 with the broadcast address, documentation, NAT64, 6to4, Teredo, discard-only, site-local and IPv4-compatible), and match IPv4-mapped and bracketed IPv6 peers against IPv4 entries. The middleware checks the resolved peer address, so behind an HTTP or SOCKS proxy it sees the proxy, not the target. A connection over a Unix socket, which has no peer IP address, now skips the check instead of failing with IP\Exception\InvalidArgumentException.serialize() from writing the Bcc and Resent-Bcc fields, which exposed blind recipients to everyone who received the message; the message and its SMTP envelope still keep themAddressList::parse() and Group::parse() gain an optional $lenient flag, and constructing a Mailbox now rejects invalid dot-atoms.SignerInfo against explicit trust anchors in SMIME\Verifier, checking its chain, validity, purpose and CA constraints, so an unknown self-signed certificate no longer establishes trust. An empty trust list now fails verification, intermediate certificates need CA basicConstraints and a current validity period, the signer certificate needs the S/MIME signing purpose, and verification needs a writable sys_get_temp_dir() within open_basedir.MultiPart\Parser constructor argument $maxHeaderSize (16 KiB by default, 0 for unlimited), so a body that never ends its part headers can no longer make the parser buffer the whole input in memory; a part header section now ends at its first blank line, so LF-only part headers are no longer split at a CRLF blank line inside a later body" in form-data field names, as browsers do, so a field name taken from user input can no longer inject header lines or fake parts into MultiPart\Form outputrequireTls unless the transport uses TLS and the server advertises REQUIRETLS, instead of silently sending without it, and keep the EHLO capabilities of a pooled connection when it is reusedSocketPool's checked-out connections by the connection objects instead of their object IDs, which PHP reuses, so checking in a foreign connection that took the ID of a dropped one no longer pools it under the dropped connection's host and port, where the next checkout for that host and port handed out a connection to another peerPeerCertificate, kept verifying client certificates against the CA of an earlier ServerConfiguration, and let an allow_self_signed left by a client handshake on the same listener accept any self-signed client certificate as the peer. With ext-sockets, which tcp now suggests, each accepted connection gets its own context; without it, a server upgrade throws Network\Exception\RuntimeException naming the option for a stream that inherited a trust option the current configuration does not set (cafile, capath, verify_peer, verify_peer_name, peer_fingerprint, allow_self_signed or verify_depth). Server handshakes no longer leave peer_certificate and peer_certificate_chain in the stream context; read the peer certificate from TLS\StreamInterface::getState().TLS\Listener::accept() its own deadline, 10 seconds by default and configurable with the new $handshakeTimeout constructor argument (a Psl\DateTime\Duration), so a peer that connects and sends nothing can no longer block the listener forever; a failed or timed-out handshake throws HandshakeFailedException and closes the connectionTLS\Listener concurrently, each in a fiber of its own with its own deadline, up to the new optional $maxPendingHandshakes constructor argument (256 by default) at a time, and return connections from accept() in the order their handshakes complete, so a peer that connects and sends nothing holds only its own slot until its deadline passes instead of every later connection; while the limit is reached, no further connection is taken from the inner listener. A failed or timed-out handshake still closes its connection and is reported to the next accept() call as HandshakeFailedException. Cancelling an accept() call now ends that call only and leaves the pending handshakes to their deadlines, and close() cancels every pending handshake, closes the connections whose handshakes completed for nobody and fails every waiting call with AlreadyStoppedExceptionVec\intersect(), which returns the values of the first iterable that are present in every other iterable as a list, without their keys, comparing values by their string representation like Dict\intersect() - #812 by @shadowhandAnsi\strip() and Ansi\contains() recognize every ECMA-48 escape sequence (CSI with private markers, sub-parameters, intermediate or non-letter final bytes, DCS, SOS, PM and APC strings, SS2 and SS3, and two-byte escapes such as \e7) instead of only simple CSI and OSC sequences, so strip() now removes more than beforeSemaphore and KeyedSemaphore from running more operations than their limit by handing a released slot directly to the next pending operation; admission is now first in, first out, so a caller that releases a slot and calls waitFor() again queues behind pending operationsKeyedSemaphore slot per key however deep its re-entrant calls (an operation calling waitFor() again for its own key) go: a re-entrant call runs at once on that slot instead of taking a free one, so other callers for the key may start while it runs, up to the limit, and it no longer takes the count above the limit, which let unrelated callers in beyond it and made waitForPending() return at once. getOngoingOperations() and getTotalOngoingOperations() count each fiber once per key, not each re-entrant call, and getOngoingOperations() never exceeds the limit.Async\all(), Async\any() and Async\first(), which failed because they traverse their input more than once; non-array iterables are now consumed once up front, and all() awaits every awaitable even when keys repeatKeyedSequence operation and calls waitFor() again for the same key wait behind the operations already pending, instead of being taken for a re-entrant call and running at the same time as the next one, which also let a Cache\LocalStore call for a key overtake the calls already waiting for itAsync\concurrently() await a task whose key repeats like any other task, instead of awaiting only the last task under that key while the earlier ones kept running unobserved, their failures reaching the event loop as unhandled awaitables; on success, the last task's result is still returned under that keyTaskGroup::awaitAll() call waiting when the last task finishes the same outcome, so they all throw the same exception or CompositeException object, where only the first call to resume threw and the others returned as if every task had succeededSignalCancellationToken, TimeoutCancellationToken and LinkedCancellationToken call every subscribed callback when one throws, instead of dropping the later ones, which typically left the fibers waiting on the token suspended as if it had not been cancelled; the failure is reported once all have run, where it went before, as a CompositeException in subscription order when several throwAwaitable::await() call, instead of keeping it, with the wait's suspension and token, until the awaitable completes, possibly never, so repeated cancelled waits on a pending awaitable no longer accumulate memoryAsync\main() and Scheduler::run() throw the new Async\Exception\LogicException, a Psl\Exception\LogicException, when they are called inside a fiber, such as a task or an event loop callback, before doing anything. Scheduler::run() threw Revolt's undocumented \Error there, and main() ran its closure first, then failed with that \Error or the closure's own exception, so a catch of either no longer matches; a closure that never returned to main(), such as one that calls exit(), ran inside the fiber and worked, and is now rejected before it runs, so call main() outside any fiber or call the closure directly.Cache\Exception\InvalidArgumentException from the LocalStore constructor for a max size below 1, instead of looping forever on the first writeLocalStore that is no longer referenced be garbage collected, instead of the event loop keeping it, its entries and its cleanup timer alive until the process endsLocalStore cleanup timer, so an event loop with nothing left to do but sweep expiring entries now returns instead of waiting for them to expirereceive() and send() calls from hanging when they queue behind another waiter: a call no longer waits on a closed channel, and a receive or send that leaves messages or space behind wakes the next waiter, including when the waiter ahead was cancelledreceive() and send() exactly once, so a token cancelled after the call was woken or while it subscribes, or a token whose subscribe() sends, receives, closes or throws, no longer raises Revolt's "Must call suspend() before calling throw()" Error or resumes a suspension elsewhere in the fiberreceive() or send() that finds its message or space already taken (by tryReceive(), for example) wait again in its original place in line, instead of throwing EmptyChannelException or FullChannelExceptionCIDR\Block::contains() to the block's own address family, so ::/0 no longer contains IPv4 addresses and IPv4 blocks no longer contain IPv4-mapped IPv6 addresses, and mask host bits when a block is built (192.168.1.5/24 is 192.168.1.0/24). Code that relied on cross-family matching must check both forms of an address itself, as DeniedDestinationsMiddleware now does, which keeps its IPv4-mapped deny entries matching.conflict with php-standard-library/http-client before 6.4.0, since the DeniedDestinationsMiddleware::forPrivateNetworkRanges() preset of http-client 6.2.0 to 6.3.0 relied on cross-family CIDR containment and on bracketed IPv6 peer addresses, and next to cidr and network 6.4.0 would let ::ffff:169.254.169.254 through; Composer now updates http-client together with them or refuses the updateVector::fromItems(), MutableVector::fromItems(), Set::fromItems() and MutableSet::fromItems() ignore the keys of the given iterable, so elements are no longer dropped when keys repeat and keys that are not valid array keys no longer throw a TypeErrorCompressingWriteHandle and DecompressingWriteHandle in linear time instead of copying the unwritten remainder after every partial write to the inner handleflush() on CompressingWriteHandle and DecompressingWriteHandle write only what the inner handle has not accepted yet, instead of finishing the stream again and rewriting everything with a second trailer; an inner write that accepts nothing now fails the flush with an IO RuntimeExceptionStreamEncryptor::copySealed() until it is full or the source reaches its end, and emit TAG_FINAL only there, so a short read from a pipe or socket no longer ends the sealed stream early; chunk sizes outside 1..MAX_CHUNK_BYTES now throw InvalidArgumentException before anything is writtenHkdf\expand() and Hkdf\extract() from the actual HMAC digest length, so SHA-1 output can no longer exceed 255 blocks and valid SHA3-512 output is no longer rejected; the maximum output is now 255 times the real digest sizeFormatPattern::UnixTimestamp format and parse whole seconds since the Unix epoch instead of the year, FormatPattern::JulianDay give the Julian day number instead of an ordinal date, and FormatPattern::IsoWeekDate give an ISO 8601 week date such as 2024-W03-1 for every locale. The values of JulianDay and IsoWeekDate change, so FormatPattern::from('yyyy DDD') and FormatPattern::from('Y-ww-E') no longer match; pass those patterns as strings for the old output.Timestamp::parse(), DateTime::parse() and fromString(), which dropped the fraction, so format() and parse() round trips with FormatPattern::Rfc3339, Iso8601 and LogTimestamp keep milliseconds and a time with a fraction before the epoch no longer parses one second late; digits past the third are still droppedDateTime\Exception\OverflowException, or UnderflowException when negative, for a Duration whose total whole seconds fall outside -PHP_INT_MAX..PHP_INT_MAX, Duration::seconds(PHP_INT_MIN) included, instead of emitting warnings and returning a wrong value, and compute large durations exactly. Timestamp::plus(), minus() and fromParts(), and since(), throw the same exceptions instead of a TypeError when the seconds leave the int range, and Duration::toStdlib() no longer fails beyond 12 digits of seconds and keeps the fraction in the interval's f.DateTime::fromParts(), withDate(), withTime(), month arithmetic and plus(Period) no longer move a value before 1970 one second later (fromParts(Timezone::UTC, 1969, 12, 31, 23, 59, 59) gave the timestamp 0)getYear() documents (1 BC is 0, 2 BC is -1): fromParts() accepts years of 0 and below instead of throwing, getYear(), getEra() and getYearShort() report the years of BC instants correctly, year arithmetic can cross into BC, and toRfc3339() and the FormatPattern formats print 0000 and -0005 instead of the era-relative year. FormatPattern::XmlRpc formats a negative year but cannot parse it.fa_IR or ar_SA@calendar=islamic-umalqura, no longer turns the fields of fromParts(), fromTimestamp(), withDate(), month arithmetic and toIntl() into that calendar's; toIntl() returns an IntlGregorianCalendar that keeps the locale's week dataDateTimeImmutable in toStdlib() and to IntlCalendar in toIntl() by instant instead of through the wall-clock fields, so a local time that happens twice keeps its offset, toIntl() keeps the milliseconds and BC years convert; before 1582-10-15, the DateTimeImmutable shows the proleptic Gregorian date of the same instantOverflowException or UnderflowException from fromParts(), withDate(), withYear() and calendar arithmetic for years outside -5838268 to 5368709, which ICU cannot compute, instead of a TypeError, a ValueError, a misleading UnexpectedValueException or a wrong, clamped instantplusDays(), minusDays(), plusWeeks(), minusWeeks(), atStartOfWeek(), atEndOfWeek() and the day part of plus(Period) and minus(Period)) move the local date instead of adding 86400 seconds per day, so the wall-clock time stays the same across a DST change: a time that a forward change skips moves forward by the length of the gap, and a repeated one keeps the offset in effect before when it can. A day count whose seconds overflow an int no longer ends in a TypeError; a result outside the supported years throws OverflowException or UnderflowException. Use plus(Duration::hours(24 * $n)) for exact elapsed time.plusMonths(), minusMonths(), plusYears() and minusYears() from throwing UnexpectedValueException when the wall-clock time does not exist on the target day because of a DST change; they resolve it as day arithmetic does, and throw OverflowException or UnderflowException outside the supported years instead of a TypeErrortoRfc3339() and the machine-readable FormatPattern cases (every case except SimpleDate, American, WeekdayMonthDayYear and FullDateTime) with the en_US_POSIX locale when no locale is given, so the default locale no longer changes their digits (Arabic-Indic under ar_EG) or their month and weekday names, which also broke parsing English RFC 2822 datesTimezone cases EuropeKyiv, AmericaCiudadJuarez, PacificKanton and AmericaCoyhaique for zones that current tzdata lists, so code running in one of them through Timezone::from(), fromStdlib(), fromIntl() or date.timezone no longer fails or falls back to UTC. With ICU data older than the renames, EuropeKyiv and PacificKanton use the rules of Europe/Kiev and Pacific/Enderbury, while AmericaCiudadJuarez needs ICU 73 and AmericaCoyhaique ICU 78: on older ICU data, using them throws DateTime\Exception\RuntimeException, and with date.timezone set to one of them, Timezone::default() throws it where 6.3.0 returned UTC.Timezone::default() instead of silently falling back to UTC (for example US/Eastern, Asia/Calcutta, Etc/UTC or Etc/GMT+5), and in Timezone::fromStdlib(), Timezone::fromIntl(), DateTime::fromStdlib() and DateTime::fromIntl(), which leaked a ValueError; offset and abbreviation DateTimeZones map to the case of their fixed offset. A zone with no equivalent case now throws, DateTime\Exception\RuntimeException from default() and InvalidArgumentException from the interop methods. The new Timezone::Minus1200 case covers Etc/GMT+12. The System V names that observe daylight saving time (CET, MET, EET, WET, CST6CDT, EST5EDT, MST7MDT and PST8PDT), links since tzdata 2024b, resolve to their link targets (for example Europe/Brussels or America/New_York) whatever the ICU data of the build.DateTime\Exception\RuntimeException instead of InvariantViolationException when the ICU data of the build does not know a Timezone case (from getOffset(), getRawOffset(), getDaylightSavingTimeOffset(), usesDaylightSavingTime(), getDaylightSavingTimeSavings(), hasTheSameRulesAs() and toIntl()), or when the system has no monotonic clock (Timestamp::monotonic())atStartOfDay(), atEndOfDay(), atStartOfMonth(), atEndOfMonth(), atStartOfYear(), atEndOfYear() and the week helpers from throwing on days whose midnight or 23:59:59 a DST change skips, such as 2024-04-26 in Africa/Cairo; the start of a day is its first instant and the end its last, so atStartOfDay() on a day whose midnight repeats now returns the first midnightFormatPattern::Http and FormatPattern::Cookie produce valid dates, always formatted and parsed in UTC and labelled GMT whatever timezone is given, and make FormatPattern::Email print a numeric offset (+0200) instead of ICU's localized GMT format; the values of these three cases changeInvalidArgumentException from fromParts(), fromTimestamp() and the arithmetic that lands on thematEndOf*() helpers return no longer rounds up to the next day, month or year in format(), getWeekday(), getISOWeekNumber(), getDayOfYear() and Timestamp::toString(); formatted fractions of a second are now truncated to the millisecond instead of roundedDateTime::fromIntl() instead of toward zero, which moved an instant before 1970 forward and raised a precision-loss deprecationDict\count_values() and Dict\associate() ignore the keys of non-array iterables, so values are no longer lost when keys repeat (and associate() compares the real lengths) and object keys no longer throw a TypeErrorResponseCode::RecordSetShouldNotExist from XRRSET to YXRRSET, and add the RecordSetShouldExist and BadCookie cases, decoding BADCOOKIE from the header and OPT bits. Exhaustive match expressions over ResponseCode need the new cases.FallbackResolver from trying the next resolver after NXDOMAIN or an InvalidArgumentException; only SERVFAIL, REFUSED and transport or protocol failures fall through, so a FallbackResolver that put a static resolver first must route those names with SplitHorizonResolver insteadCachedResolver honour response lifetimes: failures and zero-TTL answers are no longer cached for the 24-hour default, negative answers live for the lower of the SOA TTL and SOA MINIMUM, and cookies and padding no longer split cache keysCachedResolver by the time they spent in the cache, measured on a monotonic clock, so an outer cache can no longer keep them past their lifetimeCachedResolver for five seconds by default, as RFC 9520 requires, configurable with the new failureTtl constructor argument (1 to 300 seconds); a caller's own cancellation or deadline is never cachedUDPResolver, binding an IPv6 socket and comparing reply addresses in packed formUDPResolver and compare the reply source with that address, so replies from a nameserver configured by hostname are no longer rejectedInvalidArgumentException, instead of emitting warnings or encoding a scope of 256 as 0ProtocolException instead of reading past the end of the packet with warnings and deprecationschr() when building canonical RDATA, avoiding a PHP 8.5 deprecation for user-constructed TXTRecord strings longer than 255 bytes^6.4: dnssec requires dns ^6.4 for DNAMERecord and RecordType::DNAME, http-client requires h2 ^6.4 for StreamException::$streamId, and http-client, tcp and tls require network ^6.4 for NonRetryableExceptionInterface, so Composer can no longer install them next to a 6.3.0 release of the dependency that lacks those symbolsBase64\encode() and Base64\decode() do for any chunking: non-Mime streams no longer contain CRLF, Mime streams no longer end with CRLF, short reads no longer insert padding mid-stream, and the decoding handles reject data after padding, and non-Mime ones whitespace, with RangeException. Streams the old handles wrapped with CRLF still decode with Variant::Mime for the standard alphabet, but UrlSafe and DotSlash ones must be unwrapped first.Base64\decode() for the non-Mime variants with RangeException, instead of silently dropping it or reporting a padding errorQuotedPrintable\encode() and decode() do for any chunking: the encoding handles take optional $maxLineLength and $lineEnding constructor arguments, a lone CR breaks the line, a trailing line break is kept, a CRLF split by flush() stays one line break, and decoding no longer rewrites hard line breaks to CRLFtryRead() and tryWrite() of the Base64, Hex and QuotedPrintable handles return without waiting on the inner handle, leaving unwritten output for the next write() or flush(), and pass the cancellation token of write() to every inner write, so a write can now be cancelled or time out. Concurrent write() calls on one write handle still never lose or repeat output, but when the inner handle takes one call's output in several parts, another call's output can now come between them, where a PSL stream handle used to keep each call's output together.Hex\DecodingReadHandle reading until it has decoded a whole byte, so read() no longer returns an empty string before the end of the data and readByte() no longer throws when a read ends in the middle of a hex pairHex\decode('') instead of throwing RangeException, so Hex\decode(Hex\encode('')) round-tripsEncodedWord\encode() on character boundaries, so a multi-byte character is never split across two encoded-words, as RFC 2047 forbidsEncodedWord\encode() every character an RFC 2047 phrase does not allow, so display names written by Message\Address\Mailbox::toString() and Group::toString() no longer carry literal ,, < or > that change how recipients parse the address list= that is not followed by two hex digits literal when EncodedWord\decode() decodes a Q-encoded word, instead of turning it into a NUL or other control byteParsingException from EncodedWord\decode() for a charset mbstring does not support instead of leaking a ValueError, and accept RFC 2231 language tags such as =?US-ASCII*EN?Q?...?=EncodedWord\decode(), so NUL, vertical tab and form feed are kept, on every PHP versionEnv\Exception\RuntimeException when current_dir() or set_current_dir() fails, including for a path containing a NUL byte, instead of an InvariantViolationException or a leaked ValueError. Both extend Psl\Exception\RuntimeException, but a catch of InvariantViolationException no longer matches.File\read() or File\write() fails or is cancelled, instead of leaking the file descriptor, and the lock, for the rest of the processFile\Lock from throwing when the release fails, for example after its handle was closed; call release() to see the failureValueError: opening one for reading throws NotFoundException, and opening one for writing throws InvalidArgumentException before anything is createdValueError: the predicates return false, canonicalize() returns null, functions on existing nodes throw NotFoundException, and functions that create nodes throw InvalidArgumentExceptioncopy() before skipping an existing destination, so a missing or unreadable source throws NotFoundException or NotReadableException even when the destination exists and $overwrite is falseRuntimeException messages, as intended, so they read Failed to delete file "/tmp/foo": Permission denied.null nodes: hasNode() finds them, so adding an edge no longer discards a null node's existing edges, and shortest_path() and shortest_path_by() no longer cut a path at a null node0.1 + 0.2 and 0.3 are no longer merged into one node, NAN no longer triggers a warning, and -0.0 and 0.0 are the same node, as === saysRST_STREAM on a stream error instead of closing the connection with GOAWAY, keeping HPACK state in sync and returning the flow-control credit of rejected DATA, so the HTTP client fails only the affected request; resets sent for peer errors are limited (100 per 10 seconds by default, under the new RateLimiter::STREAM_ERROR_RESET) and exceeding it closes with ENHANCE_YOUR_CALM. StreamException gains $streamId and $errorCode.FLOW_CONTROL_ERROR instead of PROTOCOL_ERROR for flow-control failures, an initial window above 2^31-1 included, make a connection window overflow throw from readEvent() and fail the waiting calls instead of returning an empty event list, and make a stream window overflow throw StreamException and reset only that stream instead of leaving its waiters hangingcontent-length checksSETTINGS_MAX_FRAME_SIZE, setting END_STREAM only on the last oneCOMPRESSION_ERROR connection errorsendHeaders(), sendHeadersWithStatus() and sendPushPromise() throw StreamException for invalid field names or values and for connection-specific fields, and te accepts trailers in any case; the HTTP client drops connection-specific fields instead of sending themREFUSED_STREAM, so later streams still decode with the right HPACK statePUSH_PROMISE on idle, peer-initiated or half-closed (remote) streams, and fail the promised stream unless its request has valid fields, a safe cacheable method (GET or HEAD), a non-empty :authority and no content. Callers must still verify the server's authority before using a push.content-length against the received DATA on client connections, keeping the exceptions for HEAD, bodyless statuses and successful CONNECT, so a mismatched response now fails its stream instead of being acceptedSETTINGS frame in wire order, so a later duplicate can no longer hide an invalid earlier value; SettingsFrame gains $settingPairs to keep that orderMAX_CONCURRENT_STREAMS and INITIAL_WINDOW_SIZE changes once the peer acknowledges them, adjusting the windows of open streams, instead of keeping the values given at constructionSETTINGS_MAX_FRAME_SIZE changes through their acknowledgements, enforcing a reduction only once it is acknowledged and allowing an increase while it is pendingSETTINGS_HEADER_TABLE_SIZE from the peer, capping the encoder table at 1 MiB, instead of closing the connection for large valuesSETTINGS_ENABLE_PUSH value other than 0 from servers with PROTOCOL_ERRORStreamException once their stream's send side closes or the stream is reset, and fail every waiter on GOAWAY, end of data or a read failure, instead of hanging or proceeding on connection creditWINDOW_UPDATE or RST_STREAM on a stream the client reset, instead of closing the whole connectionSTREAM_CLOSED stream error and on a reserved (local) stream with a PROTOCOL_ERROR connection error, after decoding the field block so HPACK state stays in syncGOAWAY, new peer streams at or below its last stream id are processed, while streams above it are decoded and discarded with their flow-control credit returned, and a later goAway() never raises the announced last stream idFRAME_SIZE_ERROR, keeping PROTOCOL_ERROR for excess padding; the typed frame decoders throw ProtocolException or StreamException instead of FrameDecodingException for themEncoder state untouched when encode() or encodeWithStatus() rejects a header list that exceeds the size limit, so a retry produces a block the peer can decode; iterable input is read only onceDecoder::resize() changes the allowed limit, shrinking it only when it exceeds the new limitHtml\encode(), as encode_special_characters() does, instead of returning an empty string for the whole inputREFUSED_STREAM or a GOAWAY below its stream) or, for GET, HEAD, OPTIONS, TRACE and requests with an Idempotency-Key header, when the session failed before any response headersRequestException otherwise, instead of resending an empty or partial bodyLocation references with RFC 3986 rules, so a URL inside a query or fragment no longer changes the target's scheme, and follow only http and https targets, throwing ProtocolException otherwisemaxConcurrentStreams and the server's SETTINGS_MAX_CONCURRENT_STREAMS, holding each slot until its stream closes, resets or failsCANCEL and freeing its slot, and always write frames whole, so cancelling a request no longer corrupts the shared connection100 Continue, one second by default and configurable with the new ClientConfiguration::$expectContinueTimeout, never send the body once a final response has arrived, and stop reusing a connection whose final response came before the upload5\0 or 5\n are rejected as malformedPooledConnector destructor when one of them fails to closeRetryClient backoff, so a large attempt count or multiplier no longer overflows into a negative or nonsensical delayseek() succeeds on stream and memory handles, so readAll() after rewinding no longer stops after the first chunkReader has buffered readable after it observes the end of the inner handle, so read(), readAll(), readLine() and readFixedSize() no longer lose them after a failed readFixedSize()Reader::readByte() when a read returns an empty string before the end of the data, instead of throwingReader::readUntil() or readUntilBounded() is interrupted, so a readLine() that times out no longer loses the start of the lineReader::readUntil() and readUntilBounded() from reading the inner handle again once the end of the data was observed, which on an interactive terminal waited for more input after Ctrl-DReader::readAll(), whose end-of-data check between chunks blocked past the deadline, and keep the bytes it read buffered whenever it throws; Reader::reachedEndOfDataSource() gains an optional $cancellation argumentBoundedReadHandle from reporting a clean end of data at its limit while more bytes are still in flight, which let the HTTP client return a connection to its pool in the middle of a bodyBoundedReadHandle throw the same exception from every read after an overflow instead of reading on, which could turn a retried read into a clean end of data; the overflow is now the new IO\Exception\LimitExceededException, a RuntimeException, with the message "Data exceeded the configured limit of N bytes."WriteHandleConvenienceMethodsTrait, which copied the unwritten remainder after every partial write (writing 16 MiB to a Unix socket went from about 1.4 s to about 40 ms)IO\pipe(), the Close*StreamHandle classes and File handles, which the event loop kept alive with their stream open until the end of the processread() or tryRead() call on stream handles and throw IO\Exception\RuntimeException on a connection reset, on plain and TLS sockets alike, instead of returning the truncated data as a clean end of data; every later read throws again. Reads may now return fewer bytes per call, and a datagram socket returns one datagram per read. On a socket, reachedEndOfDataSource() no longer probes the connection, so it reports a close by the peer only after a read has returned an empty string.CancelledException instead of a Revolt Error, and a token can no longer cancel a later wait of the same fiber that it was not passed toIO\Exception\RuntimeException instead of InvariantViolationException when spool(), pipe(), the standard stream handles or File handles cannot open their stream, and stop a path containing a % conversion from turning that failure into an ArgumentCountError. Both extend Psl\Exception\RuntimeException, but a catch of InvariantViolationException no longer matches.TeeWriteHandle owes its second handle in linear time instead of copying the remainder on every callTeeWriteHandle's progress when a write to the second handle fails part way, so a retried flush() no longer writes the same bytes twice and a failed write() no longer loses them; tryWrite() returns 0 while a write() or flush() is in progressclose() of ConcatReadHandle, JoinedReadWriteHandle and TeeWriteHandle close every handle they own even when one fails, rethrowing the first failure, close a handle passed twice only once, and do nothing when called againRuntimeException when closing fails (other throwables still escape), and make a repeated close() of FixedLengthReadHandle or TruncatedReadHandle a no-opIO\input_handle() and borrowing handles such as ReadStreamHandle no longer leave standard input or the caller's stream nonblockingAddress bytes in binary in compare(), which compared addresses whose bytes form numeric strings as numbers (for example reporting 32.32.49.50 and 48.48.49.50 as equal)Iter\is_empty() at the first element instead of consuming the whole iterable, so it returns for infinite generators and leaves a generator on its first elementIter\random() pick values whose keys repeat in the iterable, and accept keys that are not valid array keys, instead of dropping those values or throwing a TypeErrorMath\Exception\OverflowException when Math\sum() overflows instead of returning a meaningless value with a PHP warning; a sum whose intermediate overflows cancel out still returns the exact resultMath\from_base() (from_base('2', 2) returned 2), and throw OverflowException instead of a TypeError when the last digit overflowsDate header, instead of PHP's default trim set, which silently dropped NUL and vertical tab, and form feed on PHP 8.6 onlyGroup::parse(), and quote ASCII specials in Group::toString(), so groups with quoted names survive a round tripxn-- A-labels in address headers, so a message whose only non-ASCII parts are IDN domains can be sent through servers without SMTPUTF8; labels longer than 63 bytes are rejected"Team <Europe>" and quoted local parts parseMediaType, MediaRange, MediaPreferences, Parameters, ContentDisposition, ContentId), instead of also dropping NUL and vertical tab, and form feed on PHP 8.6 onlyDKIM\Signer could be verified by a conforming verifierDKIM\Signer, so messages with several Received or other repeated fields verifybh= matches what verifiers computel= tag whenever the body was truncated to the configured maximum length, so signatures made with withBodyMaxLength() alone verifyDKIM\Signer, so LF messages are no longer returned with mixed line endingsMultiPart\Form::addPart(), so uploads built from Part\Data or Part\Text arrive as files instead of base64 text fields; CR, LF and " in the filename are percent-encodedapplication/json instead of text/plainBM signature, so text starting with "BM" is no longer sniffed as image/bmp-- or by padding and a line break, so a body containing the delimiter elsewhere is no longer cut shortmaxParts limit as soon as another part starts, instead of first reading the whole extra partCompositeListener::accept() instead of claiming all listeners stopped, wake every waiting call once they really have, and cancel the inner accepts when the last waiting call is cancelled, after which any failure other than the resulting CancelledException still reaches the next accept() call. After close(), an inner accept failure that is not an IO, Network or cancellation exception, such as an Error, reaches the event loop instead of being dropped.CompositeListener accepting while several calls wait, so every waiting call after the first no longer misses later connectionsCompositeListener::accept() referenced, so the cycle collector can no longer destroy them and leave later connections accepted for nobodyCompositeListener::close() wake every waiting accept() call with AlreadyStoppedException and cancel the inner accepts before closing anything, then attempt to close every backlog connection and inner listener, throwing the first IO or Network RuntimeException afterwards, instead of stopping at the first failure with the rest left open and the waiting calls never wokenTCP\RetryConnector retries it), with the errno as its code and the system's text for it in its message when ext-sockets, which the network package now suggests, is loaded, and throw instead of falling back to the local address when a peer lookup fails. TCP listeners close and skip accepted sockets whose peer lookup fails, and a Unix connect, which never completes later, returns its socket at once, without waiting for it to become writable or subscribing to its cancellation token.Network\Address::$host without brackets (::1, not [::1]) and add them only when building stream endpoints, so IPv6 addresses work across TCP, TLS, UDP and SOCKS and both spellings share a pooled connectionNetwork\socket_pair() stream, so the peer sees an orderly end of the stream instead of a reset that drops the last bytes writtenNetwork\socket_pair() stream that loses its bytes to a concurrent read wait for more instead of throwing, and make close() end a waiting peek with IO\Exception\AlreadyClosedException instead of leaving it waiting forever on the closed socket, which failed the event loopCompositeListener::accept(), TCP\RetryConnector backoffs, UDP receives, peeks and sends, and TLS handshakes, lazy accepts and pending writes), so an already cancelled token throws its CancelledException instead of Revolt's "Must call suspend() before calling throw()" Error, and a token can no longer cancel a later wait of the same fiber that it was not passed toPassword\Exception\InvalidArgumentException from get_information() for strings that are not bcrypt or Argon2 hashes instead of reporting them as Argon2i, and report $2a$ and $2b$ hashes as bcryptRuntimeException in Command and Shell\execute() instead of leaking a ValueError on PHP 8.6withClearedEnvironment() start the child from an empty environment and withoutEnvironmentVariable() withhold inherited variables, as documented, instead of still passing the parent's environment= in the name or a NUL byte with a RuntimeException before starting the process, instead of giving the child a truncated or mangled environmentExitStatus::hasBeenSignaled() and getTerminationSignal(), which always reported false and nullSignal::User1 and Signal::User2 with the platform's numbers on macOS, the BSDs and Solaris, where they used to send other signals (SIGBUS and SIGSYS on macOS)proc_open() dropped or passed without a name. A list of NAME=VALUE strings, which the documented array<string, string> type does not allow, now gives the child variables named 0, 1 and so on instead of working by accident.. or [BetweenRange iteration at an inclusive PHP_INT_MAX upper bound, where it looped forever yielding a float, and yield noThis release adds Type\numeric() , fixes HTTP header validation, and updates the documentation site.
This release adds Type\numeric(), fixes HTTP header validation, and updates the documentation site.
Type\numeric(): A new type for integers, floats, and numeric strings. It preserves the input’s type, so numeric strings remain strings. Coercion also accepts Stringable objects whose string value is numeric. (by @gsteel in #793)use Psl\Type;
Type\numeric()->assert(42); // 42
Type\numeric()->assert(3.14); // 3.14
Type\numeric()->assert('1.23'); // '1.23'HTTP\Client: Validates all Transfer-Encoding response fields, including repeated fields. Invalid or unsupported transfer codings now raise a ProtocolException instead of falling back to Content-Length. Valid chunked responses still take precedence over Content-Length. (by @azjezz in #806)HTTP\Client and H2: Reject conflicting Content-Length fields in HTTP/1.1 responses and HTTP/2 headers while accepting identical duplicates. (by @azjezz in #800)Dict\diff(): Corrects the PHPDoc value type bound to scalar|null|resource|Stringable, matching the string conversion used for comparisons. Runtime behavior is unchanged. (by @azjezz in #796)Iter\last_key_opt(): Corrected the description to say that the function returns the last key. (by @klifoth in #803)Install: composer require php-standard-library/php-standard-library:^6.3
Full Changelog: 6.2.1...6.3.0
numeric type - #793 by @gsteelTransfer-Encoding response fields and reject invalid or unsupported transfer codings instead of falling back to Content-Length - #806This release fixes a server-side HTTP/2 vulnerability in the Psl\H2 component ( GHSA-pw9p-jvrm-f7rm ).
This release fixes a server-side HTTP/2 vulnerability in the Psl\H2 component (GHSA-pw9p-jvrm-f7rm).
Psl\H2\ServerConnection did not validate that the total bytes received in HTTP/2 DATA frames matched the content-length header declared in the initial HEADERS frame, in violation of RFC 9113 §8.1.1 and §8.1.2.6. #777
A malicious client could:
This affects consumers using Psl\H2\ServerConnection directly to accept untrusted client traffic. Consumers of documented high-level PSL APIs are not affected.
content-length on server-side HEADERS receive (RFC 9110 §8.6: must be a non-negative decimal integer).Psl\H2\Exception\StreamException on mismatch or overflow.Client-side validation is intentionally not performed, as RFC 9110 §9.3.2 permits HEAD responses to declare content-length without sending DATA.
Psl\H2\ConnectionTrait::waitForSendWindow() now flushes pending buffered writes before suspending. Without this, frames written inside a buffered() block never reach the wire, and a peer that only sends WINDOW_UPDATE after seeing our DATA would deadlock.composer require php-standard-library/psl:^6.2.1
Discovered during internal review prior to public exploitation.
content-length header against received DATA on server connections, preventing HTTP/2 request smuggling on Psl\H2\ServerConnection (GHSA-pw9p-jvrm-f7rm)New unified Configuration replacing the deprecated ClientConfiguration and ServerConfiguration . Both ClientConnection and ServerConnection accept it.…
A massive release — three new networking stack components (HTTP, SMTP, DNS), the EitherOrBoth type with full-outer-join iterators, a major IO toolkit expansion, and broad covariance improvements across the type system.
HTTP\Message — version-agnostic HTTP message abstractions. Request/Response value objects with streaming bodies (ReadHandleInterface), FieldMap (ordered, case-insensitive headers with lazy index), ProtocolVersion covering HTTP/1.0 through HTTP/3, trailers as Async\Awaitable<FieldMap>, status/method constants per RFC 9110, and Transaction/Exchange for informational (1xx) responses and HTTP/2 server-push pairs.HTTP\Client — async HTTP/1.1 and HTTP/2 client with automatic protocol negotiation via ALPN. Connection pooling (H1 idle reuse, H2 session sharing across concurrent requests), event-driven stream dispatch, transparent reconnection on GOAWAY/TCP reset, RedirectClient and RetryClient decorators, per-request SendConfiguration, SSRF protection via DeniedDestinationsMiddleware, SOCKS5 proxy and HTTP CONNECT tunnel support, H2 flow control with BDP auto-tuning, and 104 integration tests against httpbun.MIME — comprehensive RFC 2045–2049 toolkit. Media type parsing and content negotiation, MIME part construction with automatic transfer encoding, streaming multipart bodies and parsing (alternative, related, form, generic), Content-Disposition with safe filename extraction, RFC 2231 parameter encoding with continuations and charset conversion, content sniffing from bytes or seekable handles, S/MIME signing/verification/encryption/decryption per RFC 5652/8551, and DKIM signing with RSA-SHA256 and Ed25519-SHA256 per RFC 6376/8463.Message — RFC 5322 internet message construction, parsing, and serialization. Typed header fields with fluent with*() mutation, address methods accepting string|Mailbox|AddressList, streaming serialize()/parse(), reply/reply-all/forward with automatic threading headers, RFC 5321 SMTP envelope derivation, and full RFC 5322 address parsing including RFC 2047 encoded-word support.SMTP — RFC 5321 SMTP client with connection pooling. Low-level Connection for protocol-level operations and high-level Transport managing the full lifecycle (EHLO/HELO, STARTTLS, AUTH, send, RSET). Implicit TLS on port 465 and STARTTLS upgrade with automatic detection, SMTP pipelining (RFC 2920), BDAT chunking (RFC 3030), DSN (RFC 3461), REQUIRETLS (RFC 8689), MT-PRIORITY (RFC 6710), DELIVERBY (RFC 2852), FUTURERELEASE (RFC 4865), BINARYMIME/8BITMIME/SMTPUTF8 negotiation, IDN punycode for international addresses, partial recipient success tracking, CRLF/null byte injection protection, and five authentication mechanisms: PLAIN, LOGIN, XOAUTH2, CRAM-MD5, SCRAM-SHA-256.DNS — async DNS resolution with full protocol support. SystemResolver mirrors OS DNS behavior; UDP and pooled TCP resolvers with automatic TCP fallback on truncation; DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH, RFC 8484). RacingResolver races multiple nameservers concurrently, SplitHorizonResolver routes by domain, SearchDomainResolver expands short names, HostsFileResolver checks the OS hosts file, CachedResolver decorator with TTL-aware caching, and StaticResolver for tests. Cross-platform system configuration loading on Linux, macOS, and Windows. EDNS0 extensions (cookies, client subnet, padding, NSID, keepalive). 20+ record types covering A, AAAA, NS, CNAME, MX, TXT, SRV, SOA, PTR, CAA, SSHFP, TLSA, SVCB, HTTPS, LOC, NAPTR, DS, DNSKEY, RRSIG, NSEC, NSEC3.DNSSEC — full DNSSEC validation chain. SecureResolver validates RRSIG signatures, TrustChainResolver walks DS/DNSKEY from root to target zone, CachedTrustChainResolver for performance, StaticTrustChainResolver for offline use. NSEC and NSEC3 authenticated denial of existence proofs. Seven signature algorithms: RSA/SHA-1, RSA/SHA-256, RSA/SHA-512, ECDSA P-256, ECDSA P-384, Ed25519, Ed448. Specific exceptions for signature failures, broken trust chains, invalid proofs, and unsigned responses.EitherOrBoth — three-variant disjoint union (Left/Right/Both) for values that may be present on either or both of two sides. Inspired by Rust's itertools::EitherOrBoth and Haskell's Data.These. Unlike Either, no side is privileged. Use cases: three-way diffs (insert/delete/update events), layered config merging, multi-source enrichment, dual-validation with independent failure paths, snapshot comparison, request/response pairing. Full surface: map, mapLeft, mapRight, mapAny, swap, proceed, apply, containsLeft, containsRight, plus left()/right()/both() free constructors.Iter\merge_join_by / Iter\merge_join_by_key — full-outer-join stream producers yielding EitherOrBoth events. merge_join_by is a lazy two-cursor merge over sorted inputs (O(1) memory, Comparison\Order-returning comparator). merge_join_by_key is a hash-based variant for keyed inputs that need no pre-sorting (O(|right|) memory).Eight new handle types for streaming composition:
IterableReadHandle — lazily consume an iterable<string> without buffering.ConcatReadHandle — read from two handles in sequence, switching at EOF.JoinedReadWriteHandle — combine separate read and write handles into one.TeeWriteHandle — fan out writes to two handles with backpressure buffering.SinkWriteHandle / SinkReadHandle / SinkReadWriteHandle — /dev/null-like handles for discarding writes and reporting EOF immediately on reads.TruncatedReadHandle — silently report EOF after N bytes.BoundedReadHandle — throw RuntimeException if the underlying handle exceeds N bytes.FixedLengthReadHandle — read exactly N bytes, throw on premature EOF.Plus IO\copy_chunked() and IO\copy_bidirectional_chunked() for explicit chunk-size control.
Read-only template parameters across the library are now annotated @template-covariant, letting values flow into wider declarations:
Async\Awaitable<T>, Promise\PromiseInterface<T>Result\ResultInterface<T>, Result\Success<T>, Result\Failure<T, Te>Option\Option<T>Either\Either<TLeft, TRight>, Either\Left<TLeft>, Either\Right<TRight>Tree\NodeInterface<T>, Tree\LeafNode<T>, Tree\TreeNode<T>Collection interfaces and implementations (Map, Set, Vector)Async\Sequence, KeyedSequence, Semaphore, and KeyedSemaphore now correctly distinguish contravariant inputs from covariant outputs.
H2)Configuration replacing the deprecated ClientConfiguration and ServerConfiguration. Both ClientConnection and ServerConnection accept it. Client-side BDP auto-tuning is now available when maxReceiveWindowSize is set on the unified config.TCP\bindTo — bind to a specific local address before connecting or listening. Available on both ConnectConfiguration and ListenConfiguration with withBindTo() builders; connect() respects it via socket.bindto.Type\bool() — now coerces 'true'/'false' string literals (thanks @veewee, #735).Type\class_string — allow null argument to assert or coerce a bare class-string.HTTP\Client\SendConfiguration::$connectionTimeout — per-request maximum duration for TCP + TLS handshake, using a linked cancellation token.IO\copy() flushes the writer if it implements BufferedWriteHandleInterface — no data left in buffers.Async\State no longer captures $this in queued callbacks, fixing delayed GC of Deferred/Awaitable chains.URI correctly parses bare IPv6 addresses (e.g., http://::1/path) as IPHost instead of misparsing as a registered name with numeric port.H2 separates maxConcurrent (peer's limit on our streams) from peerMaxConcurrent (our limit on peer's streams), so client's own SETTINGS no longer limit its outgoing streams.H2\BDPEstimator emits an initial connection-level WINDOW_UPDATE during initialize(), bringing the receive window from the RFC default (65535) up to initialWindowSize to prevent flow-control stalls under burst concurrency.H2 waiter notification copies the list before iterating and properly removes satisfied waiters — no iteration corruption or memory leaks.IO\ResourceHandle read/write callbacks and cancellation subscriptions null out the suspension reference before resuming or throwing — no more "Must call suspend() before calling throw()" errors during handle destruction or shutdown races.Will be removed in PSL 7.0:
TCP\Socket — use ConnectConfiguration::$bindTo / ListenConfiguration::$bindTo.H2\ClientConfiguration and H2\ServerConfiguration — use the unified H2\Configuration.Install: composer require php-standard-library/psl:^6.2
EitherOrBoth component - a three-variant disjoint union (Left / Right / Both) for values that may be present on either or both of two sides, inspired by Rust's itertools::EitherOrBoth and Haskell's Data.These. Primary use case: three-way diff of two collections (insert / delete / update events). Secondary: layered config merge, multi-source enrichment, dual-validation, snapshot comparison. Full map / mapLeft / mapRight / mapAny / swap / proceed / apply / containsLeft / containsRight surface; left() / right() / both() free constructors.Iter\merge_join_by and Iter\merge_join_by_key - full-outer-join stream producers that yield EitherOrBoth events as a rewindable Iter\Iterator. merge_join_by is a lazy two-cursor merge over sorted inputs (O(1) memory on first traversal, Psl\Comparison\Order-returning comparator, matching Rust's itertools::merge_join_by); merge_join_by_key is a hash-based variant for keyed inputs that do not need to be pre-sorted (O(|right|) memory).IO\IterableReadHandle - a streaming ReadHandleInterface that lazily consumes an iterable<string> without buffering the entire content in memoryIO\ConcatReadHandle - reads from two handles in sequence, switching to the second when the first reaches EOFIO\JoinedReadWriteHandle - joins a ReadHandleInterface and WriteHandleInterface into a single read-write handle, delegating all operations to the respective underlying handleIO\TeeWriteHandle - writes to two handles simultaneously with backpressure buffering when the second handle is slowerIO\SinkWriteHandle - a /dev/null-like write handle that discards all written dataIO\SinkReadHandle - a read handle that is always at EOF, unlike MemoryHandle('') which only reports EOF after the first readIO\SinkReadWriteHandle - a sink that discards writes and always reports EOF on readsIO\TruncatedReadHandle - reads up to N bytes from an underlying handle, silently reporting EOF when the limit is reachedIO\BoundedReadHandle - reads up to N bytes from an underlying handle, throwing RuntimeException if the underlying handle has more data than the limit allowsIO\FixedLengthReadHandle - reads exactly N bytes from an underlying handle, throwing RuntimeException on premature EOFIO\copy_chunked() and IO\copy_bidirectional_chunked() - variants of IO\copy() and IO\copy_bidirectional() that accept a custom chunk sizeSendConfiguration::$connectionTimeout - per-request maximum duration for establishing a connection (TCP + TLS handshake), using a linked cancellation token'true'/'false' string literals in Type\bool() coercion - #735 by @verwetoMIME component - comprehensive MIME toolkit implementing RFC 2045-2049 and related standards
MediaType, MediaRange, MediaPreferences) per RFC 2045, RFC 6838, RFC 9110Part\Text, Part\Data) per RFC 2045MultiPart\Composite, MultiPart\Alternative, MultiPart\Related, MultiPart\Form, MultiPart\Parser) per RFC 2046, RFC 2387, RFC 7578Headers)ContentDisposition) per RFC 2183cid: URI support (ContentId) per RFC 2392Parameters)Sniff\from_string, Sniff\from_handle)SMIME\Signer, SMIME\Verifier, SMIME\Encryptor, SMIME\Decryptor) per RFC 5652, RFC 8551DKIM\Signer) per RFC 6376, RFC 8301, RFC 8463Message component - RFC 5322 internet message construction, parsing, and serialization
with*() methods (Message) per RFC 5322string|Mailbox|AddressList for conveniencePartInterface from the MIME component per RFC 2045serialize() and parse() accepting string or ReadHandleInterfaceEnvelope) per RFC 5321Mailbox, Group, AddressList with RFC 2047 encoded-word supportSMTP component - RFC 5321 SMTP client with connection pooling, TLS, and authentication
Connection implementing Network\StreamInterface for protocol-level SMTP operationsTransport managing the full SMTP lifecycle: connect, EHLO/HELO, STARTTLS, AUTH, send, RSETTCP\SocketPoolEnhancedStatusCode parsingSendConfigurationDuration or DateTimeInterfaceDeliveryReport for per-recipient rejection trackingPossibleAttackExceptionTransportConfiguration and SendConfiguration with fluent with*() buildersDNS component - async DNS resolution with full protocol support
SystemResolver mirrors OS DNS behavior, usable as a default parameter valueTCPResolverRacingResolver races multiple nameservers concurrently for fastest responseSplitHorizonResolver routes queries by domain name for split-horizon DNSSearchDomainResolver expands short names using search domain listsHostsFileResolver checks the OS hosts file before network queriesCachedResolver decorator with TTL-aware caching via Cache\StoreInterfaceStaticResolver for hardcoded records in tests and developmentHTTPSResolver using the HTTP client (RFC 8484)ResponseCode helper methods: isSuccess(), isError(), isServerError(), isNameError()DNSSEC component - full DNSSEC validation chain
SecureResolver validates RRSIG signatures on every responseTrustChainResolver walks DS/DNSKEY chain from root to target zoneCachedTrustChainResolver caches trust chain results for performanceStaticTrustChainResolver for offline/air-gapped environmentsSignatureFailedException, BrokenTrustChainException, InvalidProofException, UnsignedResponseExceptionHTTP Message component - version-agnostic HTTP message abstractions
Request and Response immutable value objects with streaming body (ReadHandleInterface)FieldMap ordered, case-insensitive header field collection with lazy indexProtocolVersion enum covering HTTP/1.0, HTTP/1.1, HTTP/2, and HTTP/3Async\Awaitable<FieldMap> for HTTP/2 and chunked HTTP/1.1reason_phrase() function for HTTP/1.x status line serializationwith*() mutation methods on both Request and ResponseTransaction groups the final response with informational (1xx) responses and server push exchangesExchange represents a pushed request/response pair for HTTP/2 server pushHTTP Client component - async HTTP/1.1 and HTTP/2 client with connection pooling
Client with automatic protocol negotiation via ALPN (HTTP/2 preferred, HTTP/1.1 fallback)PooledConnector with HTTP/1.x idle connection reuse and HTTP/2 session sharing across concurrent requestsH2Multiplexer and per-stream H2Stream stateRedirectClient decorator following 301/302/303/307/308 redirects with method rewriting per RFC 9110, cross-origin credential stripping, and auto-referrerRetryClient decorator with configurable exponential backoff and jitter for transport-level failuresSendConfiguration for per-request overrides (body size limits, TLS, protocol versions, tunnel) merged with ClientConfiguration defaultsDeniedDestinationsMiddleware for SSRF protection against private IP ranges (RFC 1918, RFC 4193, loopback, link-local)HandlerInterface / MiddlewareInterface chain with access to peer address and TLS stateClientConfiguration::$proxy using Psl\Socks\ConnectorClientConfiguration::$tunnel with TLS and proxy authenticationnoTunneling host bypass rules (exact match, domain suffix, wildcard)ResponseBodyHandle implementing ReadHandleInterfaceConfiguration replacing deprecated ClientConfiguration and ServerConfiguration
ClientConnection and ServerConnection now accept Configuration in addition to their legacy config typesClientConnection now supports BDP auto-tuning when using Configuration with maxReceiveWindowSize setbindTo option to ConnectConfiguration for binding to a specific local address before connectingbindTo option to ListenConfiguration for binding to a specific local address before listeningwithBindTo() fluent builder method to both ConnectConfiguration and ListenConfigurationconnect() now respects ConnectConfiguration::$bindTo by setting the socket.bindto stream context optionType\class_string to assert or coerce bare class-string@template-covariant across the library, allowing values to flow into wider declarations:
Async\Awaitable<T>, Promise\PromiseInterface<T>Result\ResultInterface<T>, Result\Success<T>, Result\Failure<T, Te>Option\Option<T>Either\Either<TLeft, TRight>, Either\Left<TLeft>, Either\Right<TRight>Tree\NodeInterface<T>, Tree\LeafNode<T>, Tree\TreeNode<T>@template-covariant (CollectionInterface, AccessibleCollectionInterface, IndexAccessInterface, MapInterface, Map, SetInterface, Set, VectorInterface, Vector); mutable collections remain invariant.Sequence, KeyedSequence, Semaphore, KeyedSemaphore template parameters with the correct variance; keys/inputs are @template-contravariant (write-position only) and outputs are @template-covariant (read-position only).Vector::getIterator() and MutableVector::getIterator() return type from Iterator<int<0, max>, T> to Iterator<int, T>.IO\copy() now flushes the writer after copying if it implements BufferedWriteHandleInterface, ensuring no data remains in an internal bufferState::subscribe() and State::invokeCallbacks() no longer capture $this in queued closures, preventing delayed garbage collection of Deferred/Awaitable chainshttp://::1/path) are now correctly parsed as IPHost instead of being misparsed as a registered name with a numeric portmaxConcurrent (peer's limit on our streams) from peerMaxConcurrent (our limit on peer's streams) in StreamTable, preventing the client's own SETTINGS from limiting its outgoing streamsBDPEstimator now produces an initial connection-level WINDOW_UPDATE during initialize() to bring the receive window from the RFC default (65535) up to initialWindowSize, preventing flow-control stalls when many concurrent streams receive data simultaneouslynotifyWindowWaiters() now copies the waiter list before iterating and properly removes satisfied waiters, preventing iteration corruption and memory leaksResourceHandle readable/writable callbacks now null out the suspension reference before calling resume(), preventing "Must call suspend() before calling throw()" errors during handle destructionResourceHandle::doRead() and doWrite() cancellation subscriptions now null out the suspension reference before throwing, preventing double-wake when cancellation and close race during PHP shutdownSocket class -- use ConnectConfiguration::$bindTo or ListenConfiguration::$bindTo instead. Will be removed in PSL 7.0.ClientConfiguration -- use Configuration instead. Will be removed in PSL 7.0.ServerConfiguration -- use Configuration instead. Will be removed in PSL 7.0.This release fixes a server-side HTTP/2 vulnerability in the Psl\H2 component ( GHSA-pw9p-jvrm-f7rm ).
This release fixes a server-side HTTP/2 vulnerability in the Psl\H2 component (GHSA-pw9p-jvrm-f7rm).
Psl\H2\ServerConnection did not validate that the total bytes received in HTTP/2 DATA frames matched the content-length header declared in the initial HEADERS frame, in violation of RFC 9113 §8.1.1 and §8.1.2.6. #778
A malicious client could:
This affects consumers using Psl\H2\ServerConnection directly to accept untrusted client traffic. Consumers of documented high-level PSL APIs are not affected.
content-length on server-side HEADERS receive (RFC 9110 §8.6: must be a non-negative decimal integer).Psl\H2\Exception\StreamException on mismatch or overflow.Client-side validation is intentionally not performed, as RFC 9110 §9.3.2 permits HEAD responses to declare content-length without sending DATA.
Psl\H2\ConnectionTrait::waitForSendWindow() now flushes pending buffered writes before suspending. Without this, frames written inside a buffered() block never reach the wire, and a peer that only sends WINDOW_UPDATE after seeing our DATA would deadlock.composer require php-standard-library/psl:^6.1.2
Discovered during internal review prior to public exploitation.
Str\chr() and Str\from_code_points() now reject invalid Unicode code points
Str\chr() previously returned an empty string for invalid code points (negative values, surrogates, values above U+10FFFF) because mb_chr() returns false and it was silently cast to string. It now throws Str\Exception\OutOfBoundsException.
Str\from_code_points() had a hand-rolled UTF-8 encoder that silently produced invalid byte sequences; encoding surrogates, wrapping out-of-range values via modulo, and accepting negative inputs. The implementation has been replaced with a simple loop over Str\chr(), making both functions fully consistent. Invalid code points now throw Str\Exception\OutOfBoundsException.
use Psl\Str;
// These all threw no error before, now they throw OutOfBoundsException:
Str\chr(-1);
Str\chr(0xD800); // surrogate
Str\chr(0x110000); // above Unicode max
Str\from_code_points(72, 0xD800, 111); // throws on the surrogateValid inputs are unaffected — chr() and from_code_points() produce identical output for all valid Unicode code points (U+0000..U+D7FF, U+E000..U+10FFFF).
All ambiguous function calls have been made explicit. Every call site now uses either a use function import for global PHP functions or namespace\foo() for same-namespace functions.
Str\width(), Str\truncate(), and Str\width_slice() PHPDoc now explicitly states that width is defined by mb_strwidth() / mb_strimwidth(), and cross-references related functions like Str\length(), Str\Grapheme\length(), and Str\Grapheme\slice().usleep() resolution is too coarse for sub-millisecond timing assertions.Str\chr() now throws OutOfBoundsException for invalid Unicode code points instead of silently returning an empty stringStr\from_code_points() now validates code points and throws OutOfBoundsException for out-of-range values, surrogates, and negative inputs instead of producing invalid UTF-8; implementation now delegates to Str\chr() for consistent behaviorwidth(), truncate(), and width_slice() PHPDoc to explicitly reference mb_strwidth()/mb_strimwidth() semanticsIn PSL 5.x, we focused on the foundational networking stack-TCP, TLS, Unix sockets, UDP, and connection pooling. It was all about getting the low-leve
In PSL 5.x, we focused on the foundational networking stack-TCP, TLS, Unix sockets, UDP, and connection pooling. It was all about getting the low-level plumbing right.
With the 6.x series, we're moving up the stack and diving into protocols. Our ultimate goal is to bring robust support for HTTP/2, DNS, SMTP, WebSockets, and more. PSL 6.1.0 is the crucial first step: it delivers the core infrastructure that all of these upcoming features will rely on.
Everything in 6.1 was built with a clear destination in mind. We are paving the way for:
The components introduced today are the engine for this roadmap. The new H2 connections will drive the HTTP client and server, the new async Cache will back the DNS resolver, and the new Compression system will handle content-encoding seamlessly.
We've added streaming compression and decompression natively to IO handles. By defining your own CompressorInterface or DecompressorInterface (brotli, gzip, zstd, etc.), PSL gives you four handle decorators to wire them directly into the IO system:
CompressingReadHandle & CompressingWriteHandleDecompressingReadHandle & DecompressingWriteHandleWe've also included compress() and decompress() convenience functions for simple, one-shot operations. Under the hood, write handles implement the new BufferedWriteHandleInterface for explicit flushing and cancellation, while read handles accept configurable chunk sizes. Compressors automatically reset after calling finish(), making them easily reusable across streams.
This release includes a complete RFC 7541 encoder and decoder, featuring static table lookups, dynamic table indexing, and Huffman coding.
We wanted to be absolutely certain of its reliability, so we tested it against 14 independent implementations from the http2jp test suite. That translates to 1,172 tests and over 102,000 assertions, covering every encoding variant and edge case with full roundtrip verification.
We’ve shipped full support for the HTTP/2 binary framing protocol (RFC 9113), plus key extensions.
To keep responsibilities clean, connections are split by role. ServerConnection handles client prefaces, response headers, server pushes, Alt-Svc, and ORIGIN. Meanwhile, ClientConnection manages connection prefaces, priority signaling, and extended CONNECT.
Comprehensive Frame Support:
ALTSVC (RFC 7838) for HTTP/3 migration signaling.ORIGIN (RFC 8336) for connection coalescing.PRIORITY_UPDATE (RFC 9218) for extensible prioritization.Smart, Async-Native Flow Control:
We've designed flow control to get out of your way. sendAllData() automatically chunks payloads by window size and waits for updates. waitForSendWindow() suspends the fiber entirely (zero polling!) and resumes exactly when the window opens. Multiple fibers can wait on different streams with independent cancellation, and connection-level updates efficiently wake all relevant waiters.
Additional H2 Features:
getStreamState(), activeStreamCount(), isConnected()).ServerConfiguration and ClientConfiguration using fluent with* builders.We're introducing an async-safe, in-memory LRU cache. The standout feature here is per-key atomicity powered by KeyedSequence.
If two fibers request the same cache key simultaneously, only one will compute the result. The other simply waits and receives the cached value—preventing cache stampedes and eliminating duplicate work.
LocalStore: A bounded LRU cache with a configurable max size and TTL support. It uses an event loop timer for proactive expiration, dropping to zero overhead when there are no expiring entries.NullStore: A dummy cache that never stores and always recomputes. It's perfect for testing or temporarily disabling caching without having to modify your calling code.We've introduced BufferedWriteHandleInterface, which extends the standard WriteHandleInterface with a flush() method. This is essential for handles that buffer data internally (like the new compression writers) and need an explicit "send everything now" trigger with full cancellation support.
Psl\IO\BufferedWriteHandleInterface, extending WriteHandleInterface with flush() for handles that buffer data internally before writing to an underlying resourceCompression component with streaming compression/decompression abstractions for IO handles. Provides CompressorInterface, DecompressorInterface, four handle decorators (CompressingReadHandle, CompressingWriteHandle, DecompressingReadHandle, DecompressingWriteHandle), and convenience functions compress() and decompress()HPACK component - RFC 7541 HPACK header compression for HTTP/2H2 component - HTTP/2 binary framing protocol implementationCache component - async-safe in-memory LRU cache with per-key atomicity via KeyedSequence, proactive TTL expiration via event loopNo code changes. This release improves the release infrastructure.
No code changes. This release improves the release infrastructure.
6.0.x) to the tag before splitting, ensuring split repos always receive the correct commits for patch releases.See CHANGELOG.md for details.
Patch release fixing a bug in IO\Reader that affected non-blocking stream reads (TLS, TCP, etc.).
Patch release fixing a bug in IO\Reader that affected non-blocking stream reads (TLS, TCP, etc.).
Reader::readUntil() and Reader::readUntilBounded() assumed that an empty read() meant end-of-stream. On non-blocking handles (TLS, TCP, Unix sockets), read() can return empty before data arrives. This caused readLine() to return the entire stream content as a single string instead of splitting into individual lines.
This bug affected any code using IO\Reader with network streams. If you were using readLine(), readUntil(), or readUntilBounded() on a non-blocking stream and getting unexpected results, this is the fix.
Documentation source links (See src/Psl/Default/ for the full API) now link to packages/default/src/Psl/Default/ instead of the non-existent top-level src/Psl/Default/.
See CHANGELOG.md for details.
chore: update changelog
chore: update changelog (#683)
Reader::readUntil() and Reader::readUntilBounded() no longer treat empty reads from non-blocking streams as EOF, fixing readLine() returning the entire content instead of individual lines when used with non-blocking streamspackages/{name}/src/Psl/ instead of the non-existent top-level src/Psl/ pathsplitter audit command to verify organization repository settings (wiki, issues, discussions, PRs, tag immutability).This is a major release with breaking changes. The most impactful:
PSL 6.0 is the biggest release in the project's history. New home, new packages, new capabilities.
PSL has moved. The repository, the organization, the website - everything has a new address:
azjezz/psl)psl.carthage.software)php-standard-library/php-standard-library (was azjezz/psl)The azjezz/psl package is now abandoned. Run composer require php-standard-library/php-standard-library to switch.
The namespace has not changed. It is Psl\, and it will always remain Psl\.
PSL is now split into 61 independently installable packages. You no longer need to pull in the entire library.
Need just type-safe coercion? composer require php-standard-library/type
Building an async TCP server? composer require php-standard-library/tcp
Working with URIs? composer require php-standard-library/uri
Every package declares its own dependencies, so you only get what you actually use. The full library install still works for those who want everything:
composer require php-standard-library/php-standard-libraryAll 61 packages live under the php-standard-library GitHub organization, each with its own read-only split repository for Composer.
Full RFC-compliant resource identifier handling:
Standalone RFC 3492 Punycode encoding and decoding for internationalized domain names.
A new cancellation system replaces the old Duration $timeout pattern across all async/IO operations:
CancellationTokenInterface - base contractTimeoutCancellationToken - auto-cancels after a durationSignalCancellationToken - manually triggered cancellationLinkedCancellationToken - cancelled when either of two inner tokens firesTaskGroup and WaitGroup for structured concurrencyQuotedPrintable and EncodedWord encoding (RFC 2045, RFC 2047)TLS\Listener for wrapping any listener with TLSTCP\RestrictedListener for IP/CIDR-based access controlNetwork\CompositeListener for accepting from multiple listenersBufferedReadHandleInterface with readByte(), readLine(), readUntil()This is a major release with breaking changes. The most impactful:
Cancellation replaces timeouts. All null|Duration $timeout parameters are now CancellationTokenInterface $cancellation = new NullCancellationToken().
// Before (5.x)
$data = $reader->read(timeout: Duration::seconds(5));
// After (6.0)
$data = $reader->read(cancellation: new Async\TimeoutCancellationToken(Duration::seconds(5)));Naming conventions. All variables, parameters, and properties now use $camelCase.
Configuration objects. TCP\listen(), TCP\connect(), Unix\listen(), UDP\Socket::bind(), and Socks\Connector now accept configuration objects instead of individual parameters.
Removed timeout exceptions. IO\Exception\TimeoutException, Network\Exception\TimeoutException, Process\Exception\TimeoutException, and Shell\Exception\TimeoutException are removed. Use Async\Exception\CancelledException instead.
TLS renamed. TLS\ServerConfig -> TLS\ServerConfiguration, TLS\ClientConfig -> TLS\ClientConfiguration.
See the full CHANGELOG for the complete list.
RetryConnector backoff sleep now respects cancellation tokensIO\write(), IO\write_line(), IO\write_error(), IO\write_error_line(), and Str\format() no longer crash when the message contains % characters and no arguments are passedPSL is built by its community. Thank you to everyone who contributed code, reported bugs, sponsored the project, or simply used it in production.
null|Duration $timeout parameters across IO, Network, TCP, TLS, Unix, UDP, Socks, Process, and Shell components have been replaced with CancellationTokenInterface $cancellation = new NullCancellationToken(). This enables both timeout-based and signal-based cancellation of async operations.Psl\IO\Exception\TimeoutException - use Psl\Async\Exception\CancelledException instead.Psl\Network\Exception\TimeoutException - use Psl\Async\Exception\CancelledException instead.Psl\Process\Exception\TimeoutException - use Psl\Async\Exception\CancelledException instead.Psl\Shell\Exception\TimeoutException - use Psl\Async\Exception\CancelledException instead.Psl\IO\CloseHandleInterface now requires an isClosed(): bool method.Network\SocketInterface::getLocalAddress() and Network\StreamInterface::getPeerAddress() no longer throw exceptions. Addresses are resolved at construction time and cached, making these O(1) property lookups with no syscall.BufferedReadHandleInterface::readLine() now always splits on "\n" instead of PHP_EOL. Trailing "\r" is stripped, so both "\n" and "\r\n" line endings are handled consistently across all platforms. Use readUntil(PHP_EOL) for system-dependent behavior.Psl\TLS\ServerConfig renamed to Psl\TLS\ServerConfiguration.Psl\TLS\ClientConfig renamed to Psl\TLS\ClientConfiguration.$camelCase naming instead of $snake_case.TCP\listen(), TCP\connect(), TCP\Socket::listen(), TCP\Socket::connect() now accept configuration objects (TCP\ListenConfiguration, TCP\ConnectConfiguration) instead of individual parameters for socket options.Unix\listen() and Unix\Socket::listen() now accept Unix\ListenConfiguration instead of individual parameters.UDP\Socket::bind() now accepts UDP\BindConfiguration instead of individual parameters.TCP\Socket setter/getter methods (setReuseAddress, setReusePort, setNoDelay, etc.) have been removed. Use configuration objects instead.TCP\Connector constructor now accepts TCP\ConnectConfiguration instead of bool $noDelay.Socks\Connector constructor changed from (string $proxyHost, int $proxyPort, ?string $username, ?string $password, ConnectorInterface $connector) to (ConnectorInterface $connector, Socks\Configuration $configuration).ingoing to ongoing across Semaphore, Sequence, KeyedSemaphore, and KeyedSequence (hasIngoingOperations() -> hasOngoingOperations(), getIngoingOperations() -> getOngoingOperations(), etc.).Psl\Async\CancellationTokenInterface for cancelling async operationsPsl\Async\NullCancellationToken - no-op token used as default parameter valuePsl\Async\SignalCancellationToken - manually triggered cancellation via cancel(?Throwable $cause)Psl\Async\TimeoutCancellationToken - auto-cancels after a Duration, replacing the old Duration $timeout patternPsl\Async\LinkedCancellationToken - cancelled when either of two inner tokens is cancelled, useful for combining a request-scoped token with an operation-specific timeoutPsl\Async\Exception\CancelledException - thrown when a cancellation token is triggered; the cause (e.g., TimeoutException) is attached as $previous. Use $e->getToken() to identify which token triggered the cancellation.Async\sleep() now accepts an optional CancellationTokenInterface parameter, allowing early wake-up on cancellationAwaitable::await() now accepts an optional CancellationTokenInterface parameterSequence::waitFor() and Sequence::waitForPending() now accept an optional CancellationTokenInterface parameterSemaphore::waitFor() and Semaphore::waitForPending() now accept an optional CancellationTokenInterface parameterKeyedSequence::waitFor() and KeyedSequence::waitForPending() now accept an optional CancellationTokenInterface parameterKeyedSemaphore::waitFor() and KeyedSemaphore::waitForPending() now accept an optional CancellationTokenInterface parameterSenderInterface::send() and ReceiverInterface::receive() now accept an optional CancellationTokenInterface parameterListenerInterface::accept() now accepts an optional CancellationTokenInterface parameterTCP\ListenerInterface::accept() now accepts an optional CancellationTokenInterface parameterUnix\ListenerInterface::accept() now accepts an optional CancellationTokenInterface parameterTLS\Acceptor::accept(), TLS\LazyAcceptor::accept(), TLS\ClientHello::complete(), and TLS\Connector::connect() now accept an optional CancellationTokenInterface parameter - cancellation propagates through the TLS handshakeTLS\TCPConnector::connect() and TLS\connect() now pass the cancellation token through to the TLS handshakePsl\Async\TaskGroup for running closures concurrently and awaiting them all with defer() + awaitAll()Psl\Async\WaitGroup, a counter-based synchronization primitive with add(), done(), and wait()Psl\Encoding\QuotedPrintable\encode(), decode(), and encode_line() for RFC 2045 quoted-printable encoding with configurable line length and line endingPsl\Encoding\EncodedWord\encode() and decode() for RFC 2047 encoded-word encoding/decoding in MIME headers (B-encoding and Q-encoding with automatic selection)TLS\ListenerInterface and TLS\Listener, wrapping any Network\ListenerInterface to perform TLS handshakes on accepted connectionsBase64\Variant::Mime for RFC 2045 MIME Base64 with 76-char line wrapping and CRLF, using constant-time encoding/decodingEncodingReadHandle, DecodingReadHandle, EncodingWriteHandle, DecodingWriteHandle), QuotedPrintable (same 4), and Hex (same 4), bridging Psl\IO and Psl\Encoding for transparent encode/decode on read/writePsl\IO\BufferedReadHandleInterface, extending ReadHandleInterface with readByte(), readLine(), readUntil(), and readUntilBounded()Psl\IO\Reader now implements BufferedReadHandleInterfaceTCP\ListenConfiguration and TCP\ConnectConfiguration with immutable with* builder methodsUnix\ListenConfiguration with immutable with* builder methodsUDP\BindConfiguration with immutable with* builder methodsSocks\Configuration with immutable with* builder methods for proxy host, port, and credentialsTCP\RestrictedListener, wrapping a listener to restrict connections to a set of allowed IP\Address and CIDR\Block entriesNetwork\CompositeListener, accepting connections from multiple listeners concurrently through a single accept() callURI component - RFC 3986 URI parsing, normalization, reference resolution, and RFC 6570 URI Template expansion (Levels 1–4), with RFC 5952 IPv6 canonical form and RFC 6874 zone identifiersIRI component - RFC 3987 Internationalized Resource Identifier parsing with Unicode support, RFC 3492 Punycode encoding/decoding, and RFC 5891/5892 IDNA 2008 domain name processingURL component - strict URL type with scheme and authority validation, default port stripping for known schemes, and URI/IRI conversionPunycode component - RFC 3492 Punycode encoding and decoding for internationalized domain namesRetryConnector backoff sleep now respects cancellation tokens, allowing retry loops to be cancelled during the delayIO\write(), IO\write_line(), IO\write_error(), IO\write_error_line(), and Str\format() no longer pass the message through sprintf/vsprintf when no arguments are given, preventing format string errors when the message contains % charactersReplace Duration timeout parameters with TimeoutCancellationToken:
// Before (5.x)
$data = $reader->read(timeout: Duration::seconds(5));
// After (6.0)
$data = $reader->read(cancellation: new Async\TimeoutCancellationToken(Duration::seconds(5)));
For manual cancellation (e.g., cancel all request IO when a client disconnects):
$token = new Async\SignalCancellationToken();
// Pass to all request-scoped IO
$body = $reader->readAll(cancellation: $token);
// Cancel from elsewhere
$token->cancel();
Reader::readUntilBounded() reads from a handle until a suffix is found, just like readUntil() , but enforces a maximum byte limit. If the suffix is no
Reader::readUntilBounded() reads from a handle until a suffix is found, just like readUntil(), but enforces a maximum byte limit. If the suffix is not encountered within $max_bytes, an IO\Exception\OverflowException is thrown.
This is essential when reading from untrusted sources. for example, capping HTTP header lines so a malicious client cannot exhaust memory by sending an endless line:
use Psl\IO;
$reader = new IO\Reader($connection);
// Read a header line, but never buffer more than 8KB
$line = $reader->readUntilBounded("\r\n", max_bytes: 8192);Type\json_decoded() and Type\nullish()Two new type coercions from @veewee:
Type\json_decoded(TypeInterface $inner): accepts a JSON string and transparently decodes it, then coerces the result through $inner. Useful for APIs and form fields that pass structured data as JSON strings.
Type\nullish(TypeInterface $inner): matches null, the absence of a key (for shape fields), and the inner type. Ideal for optional-and-nullable shape fields where "missing" and "null" should be treated the same.
Documentation: psl.carthage.software/ | IO | Type
Full Changelog: 5.4.0...5.5.0
Reader::readUntilBounded(string $suffix, int $max_bytes, ?Duration $timeout) method, which reads until a suffix is found, but throws IO\Exception\OverflowException if the content exceeds $max_bytes before the suffix is encountered - #620 - by @azjezzIO\Exception\OverflowException exception class - #620 - by @azjezzType\json_decoded() type for transparent JSON string coercion - #619 by @veeweeType\nullish() type for optional-and-nullable shape fields - #618 by @veeweeTCP\listen() now accepts a backlog parameter (default 512) to configure the OS-level queue of pending connections. The listener also now drains the ac
TCP\listen() now accepts a backlog parameter (default 512) to configure the OS-level queue of pending connections. The listener also now drains the accept backlog in a loop instead of accepting one connection per event-loop tick, dramatically improving throughput under high connection rates.
use Psl\TCP;
$listener = TCP\listen('127.0.0.1', 8080, backlog: 4096);
Dict\{filter_nonnull_by, map_nonnull}, Vec\{filter_nonnull_by, map_nonnull}New collection helpers for filtering and mapping with null-awareness.
Documentation: psl.carthage.software/ | TCP
Full Changelog: https://github.com/azjezz/psl/compare/5.3.0...5.4.0
backlog parameter to TCP\listen() for configuring the pending connection queue size - #617 - by @azjezzCreate a handle that writes to memory until a threshold is reached, then transparently spills to a temporary file on disk. Useful for buffering data o
IO\spool()Create a handle that writes to memory until a threshold is reached, then transparently spills to a temporary file on disk. Useful for buffering data of unknown size without risking excessive memory usage.
use Psl\IO;
$handle = IO\spool(); // default 2MB threshold
$handle->writeAll($data);
$handle->seek(0);
$contents = $handle->readAll();
$handle->close();
// Custom threshold: spool to disk after 64 bytes
$small = IO\spool(maxMemory: 64);
The returned handle implements CloseHandleInterface, SeekHandleInterface, ReadHandleInterface, WriteHandleInterface, and StreamHandleInterface.
Documentation: psl.carthage.software/5.3.0/ | IO
Full Changelog: https://github.com/azjezz/psl/compare/5.2.0...5.3.0
IO\spool() for memory-backed handles that spill to diskImmutable, binary-backed value object for IPv4 and IPv6 addresses. Parse, classify, compare, and format IP addresses with a clean API.
IP ComponentImmutable, binary-backed value object for IPv4 and IPv6 addresses. Parse, classify, compare, and format IP addresses with a clean API.
use Psl\IP\Address;
$addr = Address::parse('192.168.1.1');
$addr->family; // Family::V4
$addr->isPrivate(); // true
$addr->isGlobalUnicast(); // false
$addr->toArpaName(); // '1.1.168.192.in-addr.arpa'
$v6 = Address::v6('2001:db8::1');
$v6->toString(); // '2001:db8::1'
$v6->toExpandedString(); // '2001:0db8:0000:0000:0000:0000:0000:0001'
CIDR\Block::contains()Block::contains() now accepts string|IP\Address:
use Psl\CIDR\Block;
use Psl\IP\Address;
$block = new Block('192.168.1.0/24');
$block->contains(Address::v4('192.168.1.100')); // true
Documentation: psl.carthage.software/5.2.0/ | IP | CIDR
Full Changelog: https://github.com/azjezz/psl/compare/5.1.0...5.2.0
IP component with immutable, binary-backed Address value object and Family enumCIDR\Block::contains() now accepts string|IP\AddressTLS connection pooling: New TLS\TCPConnector implements TCP\ConnectorInterface, enabling TLS connections to be pooled via TCP\SocketPool. Pass a TCPCo
TLS\TCPConnector implements TCP\ConnectorInterface, enabling TLS connections to be pooled via TCP\SocketPool. Pass a TCPConnector to SocketPool and get automatic connection reuse without repeated TLS handshakes.TLS\StreamInterface now extends TCP\StreamInterface, making TLS streams compatible with any API that accepts TCP streams.$pool = new TCP\SocketPool(
new TLS\TCPConnector(
new TCP\Connector(),
new TLS\Connector($config),
),
);
$stream = $pool->checkout('example.com', 443);
// ... use stream ...
$pool->checkin($stream);
// Next checkout reuses the TLS connection
$stream = $pool->checkout('example.com', 443);
Full Changelog: https://github.com/azjezz/psl/compare/5.0.0...5.1.0
TLS\TCPConnector for poolable TLS connectionsTLS\StreamInterface now extends TCP\StreamInterface, enabling TLS streams to be used with TCP\SocketPoolInterfacePSL 5.0 - nicknamed Crown - is the biggest release of the PHP Standard Library to date, introducing 10 new components, a complete networking stack rew
PSL 5.0 - nicknamed Crown - is the biggest release of the PHP Standard Library to date, introducing 10 new components, a complete networking stack rewrite, and significant performance improvements across the board.
Requires PHP 8.4+.
Full-featured cryptography built on libsodium: symmetric and asymmetric encryption, digital signatures, AEAD, key derivation (KDF, HKDF), key exchange, and stream ciphers, all with a type-safe, hard-to-misuse API.
use Psl\Crypto\Symmetric;
$key = Symmetric\generate_key();
$ciphertext = Symmetric\seal('Hello, World!', $key);
$plaintext = Symmetric\open($ciphertext, $key);
// 'Hello, World!'
use Psl\Crypto\Signing;
$keyPair = Signing\generate_key_pair();
$signature = Signing\sign('This message is authentic.', $keyPair->secretKey);
$valid = Signing\verify($signature, 'This message is authentic.', $keyPair->publicKey);
// true
Structured binary data parsing and encoding with a fluent Reader/Writer API. Read and write integers, floats, and strings in any byte order. Ideal for building protocol parsers and working with binary formats.
use Psl\Binary\{Reader, Writer, Endianness};
$data = new Writer(endianness: Endianness::Big)
->u8(1) // version
->u16(0x0042) // type
->u32(5) // payload length
->bytes('Hello') // payload
->toString();
$reader = new Reader($data, Endianness::Big);
$version = $reader->u8(); // 1
$type = $reader->u16(); // 0x0042
$length = $reader->u32(); // 5
$payload = $reader->bytes($length); // 'Hello'
The Network, TCP, TLS, UDP, Unix, CIDR, and Socks components were rewritten from scratch with connection pooling, retry logic, socket pairs, and first-class TLS support.
use Psl\TCP;
$listener = TCP\listen('127.0.0.1');
$connection = $listener->accept();
$data = $connection->readAll();
$connection->writeAll($data);
use Psl\TLS;
$tls = TLS\connect('example.com', 443);
$tls->writeAll("GET / HTTP/1.0\r\nHost: example.com\r\n\r\n");
$tls->shutdown();
$response = $tls->readAll();
use Psl\CIDR;
$block = new CIDR\Block('192.168.1.0/24');
$block->contains('192.168.1.100'); // true
$block->contains('192.168.2.1'); // false
Async process management with non-blocking I/O, inspired by Rust's Command API. A safer, higher-level replacement for proc_open and friends. Psl\Shell\execute is now powered by it under the hood.
use Psl\Process\Command;
$output = Command::create('echo')
->withArguments(['Hello', 'from', 'process'])
->output();
if ($output->status->isSuccessful()) {
$output->stdout; // 'Hello from process'
}
A full terminal UI framework: buffered rendering, layouts, widgets, keyboard/mouse event handling, and ANSI styling. Build rich interactive TUI applications entirely in PHP.
use Psl\Async;
use Psl\Terminal;
use Psl\Terminal\{Event, Widget};
Async\main(static function (): int {
$app = Terminal\Application::create(new MyState(), title: 'My App');
$app->on(Event\Key::class, static function (Event\Key $event) use ($app): void {
if ($event->is('ctrl+c')) {
$app->stop();
}
});
return $app->run(static function (Terminal\Frame $frame, MyState $state): void {
Widget\Paragraph::new([
Widget\Line::new([Widget\Span::raw('Hello, World!')]),
])->render($frame->rect(), $frame->buffer());
});
});
Here's a system monitor UI demo built entirely with Psl\Terminal (source):
You can even build fully functional terminal games (source):
New Period and Interval types for representing and manipulating durations and time spans.
use Psl\DateTime;
$period = DateTime\Period::fromParts(years: 1, months: 6, days: 15);
$period->toIso8601(); // 'P1Y6M15D'
$start = DateTime\DateTime::fromParts(DateTime\Timezone::UTC, 2024, 3, 15);
$end = DateTime\DateTime::fromParts(DateTime\Timezone::UTC, 2025, 7, 20);
$between = DateTime\Period::between($start, $end);
// 1 year(s), 4 month(s), 5 day(s)
Optimizations across Vec, Dict, Str, Iter, Type, and more components. Benchmarks show up to 100% improvement in certain functions.
A new documentation website is available at psl.carthage.software.
Network, TCP, Unix)Psl\Env\temp_dir() now always returns a canonicalized pathFilesystem\create_temporary_file() now canonicalizes the temporary directory pathVec\range() now uses strict comparison for float precisionDocumentation: https://psl.carthage.software/
Full Changelog: https://github.com/azjezz/psl/compare/4.3.0...5.0.0
Network, TCP, Unix) - #585 by @azjezzPsl\Shell internals refactored; dead code removed - #596 by @azjezzPsl\Env\temp_dir() now always returns a canonicalized path - #599 by @azjezzAnsi component - #588 by @azjezzTerminal component - #589 by @azjezzProcess component - #578 by @azjezzBinary component - #598 by @azjezzInteroperability component - #582 by @azjezzTLS component - #585 by @azjezzUDP component - #585 by @azjezzCIDR component - #585 by @azjezzSocks component - #585 by @azjezzPeriod, Interval, TemporalAmountInterface - #595 by @azjezzIO\copy() and IO\copy_bidirectional() - #585 by @azjezzVec\flatten() - #583 by @azjezzCrypto component with symmetric/asymmetric encryption, signing, AEAD, KDF, HKDF, key exchange, and stream ciphers - #607 by @azjezzrange() for float precision - #581 by @azjezzcreate_temporary_file - #580, #597 by @azjezzrefactor(phpunit): resolve test case naming deprecations by @simPod in https://github.com/azjezz/psl/pull/573
uuid type by @gsteel in https://github.com/azjezz/psl/pull/568Full Changelog: https://github.com/azjezz/psl/compare/4.2.1...4.3.0
Release the handles before changing permissions when copying files by @dragosprotung in https://github.com/azjezz/psl/pull/550
Full Changelog: https://github.com/azjezz/psl/compare/4.2.0...4.2.1
Add support for PHP 8.5 by @veewee in https://github.com/azjezz/psl/pull/549
Full Changelog: https://github.com/azjezz/psl/compare/4.1.0...4.2.0
This release introduces two major new data structure components to the PHP Standard Library: Tree and Graph. These additions bring powerful hierarchic
This release introduces two major new data structure components to the PHP Standard Library: Tree and Graph. These additions bring powerful hierarchical and relational data manipulation tools to PHP developers with PSL's signature type-safe API.
make to just by @azjezz in https://github.com/azjezz/psl/pull/544A comprehensive tree data structure implementation for working with hierarchical data.
Features: Immutable tree nodes, functional operations (map, filter, reduce, fold), traversal algorithms (pre-order, post-order, level-order), search utilities, and conversion functions.
use Psl\Tree;
// Create and manipulate trees
$tree = Tree\tree('root', [
Tree\leaf('child1'),
Tree\tree('child2', [Tree\leaf('grandchild')]),
]);
// Functional operations
$doubled = Tree\map($tree, fn($x) => $x . '!');
$values = Tree\pre_order($tree); // ['root', 'child1', 'child2', 'grandchild']
$count = Tree\count($tree); // 4
// Build from database records
$tree = Tree\from_list(
$records,
fn($r) => $r['id'],
fn($r) => $r['parent_id'],
fn($r) => $r['name']
);
Use Cases: File systems, organizational hierarchies, DOM structures, category trees, menu systems.
A robust graph data structure implementation supporting both directed and undirected graphs with algorithms for analysis and pathfinding.
Features: Immutable graphs, weighted/unweighted edges, BFS/DFS traversal, shortest path (Dijkstra/BFS), topological sorting, cycle detection, flexible node types.
use Psl\Graph;
// Create and traverse graphs
$graph = Graph\directed();
$graph = Graph\add_edge($graph, 'A', 'B');
$graph = Graph\add_edge($graph, 'B', 'C');
$path = Graph\shortest_path($graph, 'A', 'C'); // ['A', 'B', 'C']
$sorted = Graph\topological_sort($graph); // ['A', 'B', 'C']
// Weighted graphs
$graph = Graph\add_edge($graph, 'NYC', 'Boston', 215);
$graph = Graph\add_edge($graph, 'NYC', 'Philadelphia', 95);
$graph = Graph\add_edge($graph, 'Philadelphia', 'Boston', 310);
$route = Graph\shortest_path($graph, 'NYC', 'Boston'); // ['NYC', 'Boston']
// Undirected graphs
$social = Graph\undirected();
$social = Graph\add_edge($social, 'Alice', 'Bob');
Use Cases: Dependency resolution, route finding, social networks, state machines, task scheduling.
New type functions for runtime validation of class members using PHP's reflection API:
Type\constant_name_of() - Validate constant namesType\enum_case_of() - Validate enum case namesType\method_name_of() - Validate method names (case-insensitive)Type\property_name_of() - Validate property namesEach includes visibility-specific variants (public_*, protected_*, private_*).
use Psl\Type;
Type\method_name_of(MyClass::class)->assert('someMethod');
Type\property_name_of(MyClass::class)->assert('someProperty');
Type\public_constant_name_of(MyClass::class)->assert('SOME_CONSTANT');
just: Migrated from make to just for improved cross-platform compatibility and developer experiencemago updated to 1.0.0-beta.32actions/setup-just bumped from v2 to v3@veewee has been added to GitHub sponsors
Full Changelog: 4.0.1...4.1.0
Graph component with directed and undirected graph support - #547 by @azjezzTree component for hierarchical data structures - #546 by @azjezzmake to just - #544 by @azjezzrefactor: remove redundant @var tags from constants by @azjezz in https://github.com/azjezz/psl/pull/533
@var tags from constants by @azjezz in https://github.com/azjezz/psl/pull/533Full Changelog: https://github.com/azjezz/psl/compare/4.0.0...4.0.1
@var tags from constants - #533 by @azjezzThis release marks a major update for the PHP Standard Library, introducing several breaking changes aimed at improving strictness, consistency, and d…
This release marks a major update for the PHP Standard Library, introducing several breaking changes aimed at improving strictness, consistency, and developer experience. The library is now much stricter in its type handling and serialization, and the static analysis has been migrated to a more powerful tool.
Psl\Result\wrap() No Longer Unwraps Nested ResultsTo reduce surprising behavior, Psl\Result\wrap() will no longer automatically unwrap a Result instance returned from within the wrapped closure. It will now consistently wrap the closure's return value in a Success object, even if that value is itself a Result.
Before:
$result = Psl\Result\wrap(fn() => Psl\Result\wrap(fn() => 'hello'));
// $result is Success('hello')
After:
$result = Psl\Result\wrap(fn() => Psl\Result\wrap(fn() => 'hello'));
// $result is Success(Success('hello'))
The JSON serialization for Map and Set collections has been changed to provide a more natural and predictable representation.
Psl\Collection\Map and Psl\Collection\MutableMap now serialize to a JSON object ({...}) in all cases, even when empty or when containing sequential integer keys. This ensures a consistent key-value structure.Psl\Collection\Set and Psl\Collection\MutableSet now serialize to a JSON array ([...]), which better represents a collection of unique values.A large number of intersection interfaces in the Psl\IO and Psl\File namespaces have been removed to simplify the component's hierarchy. These interfaces were combinations of other interfaces (e.g., CloseReadHandleInterface as CloseHandleInterface&ReadHandleInterface).
Developers should now use union types or explicit interface checks where needed. For example, instead of type-hinting CloseReadHandleInterface, use CloseHandleInterface&ReadHandleInterface.
Psl\sequence() Function RemovedThe Psl\sequence() function, which returned the last argument it received, has been removed as it provided little practical value.
Psl\Type\container()A new container<Tk, Tv> type has been added to assert that a value is an iterable with specific key and value types. Unlike iterable(), it will coerce the value to an array.
Psl\Type\int_range()The new int_range(int $min, int $max) type allows asserting that a value is an integer within a specified range. It supports the same coercions as the int() type.
Psl\Type\always_assert()This new type wrapper ensures that the inner type is always asserted, even during coercion. This is useful for disabling coercion on a per-type basis.
Psl\Iter\search_with_keys() and search_with_keys_opt()These functions provide the ability to search an iterable using a predicate that receives both the key and the value, returning the value of the first match.
Psalm to Mago for static analysis, resulting in stricter type checking and improved code quality. Many internal @psalm-suppress annotations have been removed.Dict, Iter, Regex, and Vec have been enhanced with conditional types. This allows static analysis tools to infer more precise types, especially for non-empty arrays and regex match results, reducing the need for user-land assertions.@psalm-pure have been replaced with the more generic @pure to reduce dependency on a single tool.mago has been updated to 1.0.0-beta.15.actions/checkout has been bumped from v4 to v5 in GitHub Actions.Full Changelog: https://github.com/azjezz/psl/compare/3.3.0...4.0.0
Psl\Result\wrap() no longer unwraps nested results - #531 by @azjezzPsl\Collection\Map, Psl\Collection\MutableMap, Psl\Collection\Set, and Psl\Collection\MutableSet now have a more natural JSON serialization - #512 by @josh-raiPsl\IO and Psl\File namespaces have been removed to simplify the component's hierarchy - #518 by @azjezzPsl\sequence() function has been removed - #519 by @azjezzcontainer type - #513 by @azjezzint_range type - #510 by @george-steelalways_assert type - #522 by @azjezzsearch_with_keys_opt and search_with_keys functions - #490 by @simon-podlipskyIter and Regex - #528 by @azjezzUpdate psalm, infection, mago, ... by @veewee in https://github.com/azjezz/psl/pull/506
0.12.0 by @azjezz in https://github.com/azjezz/psl/pull/509Full Changelog: https://github.com/azjezz/psl/compare/3.2.0...3.3.0
chore: switch to mago by @azjezz in https://github.com/azjezz/psl/pull/501
Full Changelog: https://github.com/azjezz/psl/compare/3.1.0...3.2.0
Allow iterable for Vec\concat first argument by @dragosprotung in https://github.com/azjezz/psl/pull/496
Full Changelog: https://github.com/azjezz/psl/compare/3.0.2...3.1.0
fix: change duration to load the correct class in loader by @phpjob in https://github.com/azjezz/psl/pull/492
Full Changelog: https://github.com/azjezz/psl/compare/3.0.1...3.0.2
fix: update filepath for NonNullType by @phpjob in https://github.com/azjezz/psl/pull/488
Full Changelog: https://github.com/azjezz/psl/compare/3.0.0...3.0.1
Added support for coercing stdClass to array by @Ocramius in https://github.com/azjezz/psl/pull/437
stdClass to array<TKey, TValue> by @Ocramius in https://github.com/azjezz/psl/pull/437json_encode never returns an empty string by @gsteel in https://github.com/azjezz/psl/pull/441apply closure should be able to return mixed by @devnix in https://github.com/azjezz/psl/pull/442Locale::default() function to retrieve default locale by @azjezz in https://github.com/azjezz/psl/pull/447Default component by @azjezz in https://github.com/azjezz/psl/pull/449ReadHandle::reachedEndOfDataSource by @azjezz in https://github.com/azjezz/psl/pull/452min(), max(), median() and mean() by @simPod in https://github.com/azjezz/psl/pull/464isSucceeded() and isFailed() by @simPod in https://github.com/azjezz/psl/pull/466isSucceeded() and isFailed() (#466) by @simPod in https://github.com/azjezz/psl/pull/469Iter\apply (Closure(T): void) $function to (Closure(T): mixed) by @devnix in https://github.com/azjezz/psl/pull/471Vec versions of the unique functions by @BackEndTea in https://github.com/azjezz/psl/pull/472Result::unwrapOr() by @simPod in https://github.com/azjezz/psl/pull/470first_opt(), first_key_opt(), last_opt(), last_key_opt() and search_opt() by @simPod in https://github.com/azjezz/psl/pull/467DateTime component by @azjezz in https://github.com/azjezz/psl/pull/446param-immediately-invoked-callable in Option by @klifoth in https://github.com/azjezz/psl/pull/475Set, SetInterface, MutableSet, and MutableSetInterface by @azjezz in https://github.com/azjezz/psl/pull/482Full Changelog: https://github.com/azjezz/psl/compare/2.9.0...3.0.0
Fix PHP84 implicit nullable types by @veewee in https://github.com/azjezz/psl/pull/456
Full Changelog: https://github.com/azjezz/psl/compare/2.9.0...2.9.1
Apply fixes for Psalm 5.17 by @veewee in https://github.com/azjezz/psl/pull/431
Option::zip(), Option::zipWith() and Option::unzip() methods by @devnix in https://github.com/azjezz/psl/pull/434Option::proceed() method by @devnix in https://github.com/azjezz/psl/pull/433Option::apply() method by @devnix in https://github.com/azjezz/psl/pull/426Full Changelog: https://github.com/azjezz/psl/compare/2.8.0...2.9.0
chore(ga): bump actions/checkout from 3 to 4 by @dependabot in https://github.com/azjezz/psl/pull/420
Full Changelog: https://github.com/azjezz/psl/compare/2.7.0...2.8.0
feat(encoding): introduce Base64\Variant enum to support encoding/decoding different variants - #408 by @Gashmob
Base64\Variant enum to support encoding/decoding different variants - #408 by @GashmobOption<never> for Option::none() - #415 by @devnixFull Changelog: https://github.com/azjezz/psl/compare/2.6.0...2.7.0
[type] introduce converted type. by @veewee in https://github.com/azjezz/psl/pull/405
converted type. by @veewee in https://github.com/azjezz/psl/pull/405numeric-string type by @veewee in https://github.com/azjezz/psl/pull/406Full Changelog: https://github.com/azjezz/psl/compare/2.5.0...2.6.0
Introduce Result\try_catch shortcut by @veewee in https://github.com/azjezz/psl/pull/403
Full Changelog: https://github.com/azjezz/psl/compare/2.4.1...2.5.0
Result\try_catch function - #403 by @azjezzundeprecate positive_int() by @dragosprotung in https://github.com/azjezz/psl/pull/400
positive_int() by @dragosprotung in https://github.com/azjezz/psl/pull/400Full Changelog: https://github.com/azjezz/psl/compare/2.4.0...2.4.1
Psl\Type\positive_int function - #400 by @dragosprotungAdd range function by @azjezz in https://github.com/azjezz/psl/pull/385
Full Changelog: https://github.com/azjezz/psl/compare/2.3.1...2.4.0
Psl\Range component - #378 by @azjezzPsl\Str\range, Psl\Str\Byte\range, and Psl\Str\Grapheme\range functions - #385 by @azjezzPsl\Type\uint function - #393 by @azjezzPsl\Type\i8, Psl\Type\i16, Psl\Type\i32, Psl\Type\i64 functions - #392 by @azjezzPsl\Type\u8, Psl\Type\u16, Psl\Type\u32 functions - #395 by @KennedyTedescoPsl\Type\f32, and Psl\Type\f64 functions - #396 by @KennedyTedescoPsl\Type\nonnull function - #392 by @azjezzandThen method - #398 by @veeweePsl\Type\positive_int function, use Psl\Type\uint instead - by @azjezzchore: update license copyright year by @azjezz in https://github.com/azjezz/psl/pull/371
reproduce and range return type is always non-empty-list @dragosprotung in https://github.com/azjezz/psl/pull/383Full Changelog: https://github.com/azjezz/psl/compare/2.3.0...2.3.1
Vec\reproduce and Vec\range return type is always non-empty-list - #383 by @dragosprotungSupport psalm v5 by @veewee in https://github.com/azjezz/psl/pull/369
Full Changelog: https://github.com/azjezz/psl/compare/2.2.0...2.3.0
feat(option): introduce option component by @azjezz in https://github.com/azjezz/psl/pull/356
Full Changelog: https://github.com/azjezz/psl/compare/2.1.0...2.2.0
introduced a new Psl\Type\unit_enum function - @19d1230 by @azjezz
Psl\Type\unit_enum function - @19d1230 by @azjezzPsl\Type\backed_enum function - @19d1230 by @azjezzPsl\Type\mixed_vec function - #362 by @BackEndTeaPsl\Type\mixed_dict function - #362 by @BackEndTeaPsl\Type\vec performance - #364 by @BackEndTeaPsl\Type\float, and Psl\Type\num - #367 by @bcremerrevolt-php/event-loop to 1.0.0 - @c7bf866 by @azjezzFull Changelog: https://github.com/azjezz/psl/compare/2.0.4...2.1.0
chore(php): fix PHP 8.2 deprecations by @jrmajor in https://github.com/azjezz/psl/pull/363
Full Changelog: https://github.com/azjezz/psl/compare/2.0.3...2.0.4
Fix file truncate writing mode by @dragosprotung in https://github.com/azjezz/psl/pull/352
Full Changelog: https://github.com/azjezz/psl/compare/2.0.2...2.0.3
Fix Filesystem\get_extension() returning empty string by @dragosprotung in https://github.com/azjezz/psl/pull/350
Full Changelog: https://github.com/azjezz/psl/compare/2.0.1...2.0.2
Use Revolt EventLoop stable version (0.2) by @simPod in https://github.com/azjezz/psl/pull/348
Full Changelog: https://github.com/azjezz/psl/compare/2.0.0...2.0.1
chore: remove deprecated functions by @azjezz in https://github.com/azjezz/psl/pull/241
Psl\Filesystem\write_file, Psl\Filesystem\append_file, and Psl\Filesystem\read_file to use Psl\File component. by @azjezz in https://github.com/azjezz/psl/pull/251Shell\execute to use async streams by @azjezz in https://github.com/azjezz/psl/pull/252await_readable, await_writable, await_signal, and wrap functions by @azjezz in https://github.com/azjezz/psl/pull/305readImmediately to tryRead, and writeImmediately to tryWrite by @azjezz in https://github.com/azjezz/psl/pull/314Full Changelog: https://github.com/azjezz/psl/compare/1.9.2...2.0.0
BC - removed Psl\Arr component.
BC - removed Psl\Type\is_array, Psl\Type\is_arraykey, Psl\Type\is_bool, Psl\Type\is_callable, Psl\Type\is_float, Psl\Type\is_instanceof, Psl\Type\is_int, Psl\Type\is_iterable, Psl\Type\is_null, Psl\Type\is_numeric, Psl\Type\is_object, Psl\Type\is_resource, Psl\Type\is_scalar, and Psl\Type\is_string functions ( use TypeInterface::matches($value) instead ).
BC - removed Psl\Iter\chain, Psl\Iter\chunk, Psl\Iter\chunk_with_keys, Psl\Iter\diff_by_key, Psl\Iter\drop, Psl\Iter\drop_while, Psl\Iter\enumerate, Psl\Iter\filter, Psl\Iter\filter_keys, Psl\Iter\filter_nulls, Psl\Iter\filter_with_key, Psl\Iter\flat_map, Psl\Iter\flatten, Psl\Iter\flip, Psl\Iter\from_entries, Psl\Iter\from_keys, Psl\Iter\keys, Psl\Iter\map, Psl\Iter\map_keys, Psl\Iter\map_with_key, Psl\Iter\merge, Psl\Iter\product, Psl\Iter\pull, Psl\Iter\pull_with_key, Psl\Iter\range, Psl\Iter\reductions, Psl\Iter\reindex, Psl\Iter\repeat, Psl\Iter\reproduce, Psl\Iter\reverse, Psl\Iter\slice, Psl\Iter\take, Psl\Iter\take_while, Psl\Iter\to_array, Psl\Iter\to_array_with_keys, Psl\Iter\values, and Psl\Iter\zip functions.
BC - signature of Psl\Iter\reduce_keys function changed from reduce_keys<Tk, Tv, Ts>(iterable<Tk, Tv> $iterable, (callable(?Ts, Tk): Ts) $function, Ts|null $initial = null): Ts|null to reduce_keys<Tk, Tv, Ts>(iterable<Tk, Tv> $iterable, (callable(Ts, Tk): Ts) $function, Ts $initial): Ts.
BC - signature of Psl\Iter\reduce_with_keys function changed from reduce_with_keys<Tk, Tv, Ts>(iterable<Tk, Tv> $iterable, (callable(?Ts, Tk, Tv): Ts) $function, Ts|null $initial = null): Ts|null to reduce_with_keys<Tk, Tv, Ts>(iterable<Tk, Tv> $iterable, (callable(Ts, Tk, Tv): Ts) $function, Ts $initial): Ts.
BC - removed bundled psalm plugin Psl\Integration\Psalm\Plugin, use php-standard-library/psalm-plugin package instead.
dropped support for PHP 8.0
BC - signature of Psl\Type\object function changed from object<T of object>(classname<T> $classname): TypeInterface<T> to object(): TypeInterface<object> ( to preserve the old behavior, use Psl\Type\instance_of )
introduced Psl\Type\instance_of function, with the signature of instance_of<T of object>(classname<T> $classname): TypeInterface<T>.
introduced a new Psl\Async component.
refactored Psl\IO handles API.
introduced a new Psl\File component.
refactor Psl\Shell\execute to use Psl\IO component.
introduced a Psl\IO\pipe(): (Psl\IO\CloseReadHandleInterface, Psl\IO\CloseWriteHandleInterface) function to create a pair of handles, where writes to the WriteHandle can be read from the ReadHandle.
BC - $encoding argument for Psl\Str functions now accepts Psl\Str\Encoding instead of ?string.
introduced a new Psl\Runtime component.
introduced a new Psl\Network component.
introduced a new Psl\TCP component.
introduced a new Psl\Unix component.
introduced a new Psl\Channel component.
introduced a new IO\write() function.
introduced a new IO\write_line() function.
introduced a new IO\write_error() function.
introduced a new IO\write_error_line() functions.
introduced a new Psl\Html\Encoding enum.
BC - $encoding argument for Psl\Html functions now accepts Psl\Html\Encoding instead of ?string.
BC - Psl\Shell\escape_command function has been removed, no replacement is available.
introduced a new Psl\Math\acos function.
introduced a new Psl\Math\asin function.
introduced a new Psl\Math\atan function.
introduced a new Psl\Math\atan2 function.
BC - The type of the $numbers argument of Psl\Math\mean has changed to list<int|float> instead of iterable<int|float>.
BC - The type of the $numbers argument of Psl\Math\median has changed to list<int|float> instead of iterable<int|float>.
introduced a new Psl\Promise component.
BC - Psl\Result\ResultInterface now implements Psl\Promise\PromiseInterface
BC - Psl\Type\resource('curl')->toString() now uses PHP built-in resource kind notation ( i.e: resource (curl) ) instead of generic notation ( i.e: resource<curl> )
BC - Psl\Str, Psl\Str\Byte, and Psl\Str\Grapheme functions now throw Psl\Str\Exception\OutOfBoundsException instead of Psl\Exception\InvaraintViolationsException when $offset is out-of-bounds.
BC - Psl\Collection\IndexAccessInterface::at() now throw Psl\Collection\Exception\OutOfBoundsException instead of Psl\Exception\InvariantViolationException if $k is out-of-bounds.
BC - Psl\Collection\AccessibleCollectionInterface::slice signature has changed from slice(int $start, int $length): static to slice(int $start, ?int $length = null): static
BC - All psl functions previously accepting callable, now accept only Closure.
BC - Psl\DataStructure\QueueInterface::dequeue, and Psl\DataStructure\StackInterface::pop now throw Psl\DataStructure\Exception\UnderflowException instead of Psl\Exception\InvariantViolationException when the data structure is empty.
BC - Psl\Filesystem\write_file($file, $content) function has been removed, use Psl\File\write($file, $content); instead.
To preserve the same behavior as the old function, use
Psl\File\write($file, $content, Filesystem\is_file($file) ? File\WriteMode::TRUNCATE : File\WriteMode::OPEN_OR_CREATE).
BC - Psl\Filesystem\read_file($file, $offset, $length) function has been removed, use Psl\File\read($file, $offset, $length) instead.
BC - Psl\Filesystem\append_file($file, $contents) function has been removed, use Psl\File\write($file, $contents, File\WriteMode::APPEND) instead.
BC - Psl\Filesystem functions no longer throw Psl\Exception\InvariantViolationException.
New exceptions:
Psl\Filesystem\Exception\NotReadableException thrown when attempting to read from a non-readable nodePsl\Filesystem\Exception\NotFileException thrown when attempting a file operation on a non-file node.Psl\Filesystem\Exception\NotDirectoryException thrown when attempting a directory operation on a non-directory node.Psl\Filesystem\Exception\NotSymbolicLinkException thrown when attempting a symbolic link operation on a non-symbolic link node.Psl\Filesystem\Exception\NotFoundException thrown when attempting an operation on a non-existing node.introduced Psl\Hash\Algorithm enum.
introduced Psl\Hash\Hmac\Algorithm enum.
BC - Psl\Hash\hash, and Psl\Hash\Context::forAlgorithm now take Psl\Hash\Algorithm as an algorithm, rather than a string.
BC - Psl\Hash\Hmac\hash, and Psl\Hash\Context::hmac now take Psl\Hash\Hmac\Algorithm as an algorithm, rather than a string.
BC - A new method chunk(positive-int $size): CollectionInterface has been added to Psl\Collection\CollectionInterface.
introduced a new Psl\OS component.
introduced Psl\Password\Algorithm enum
BC - all constants of Psl\Password component has been removed.
BC - function Psl\Password\algorithms() have been removed.
BC - Psl\Result\ResultInterface::getException() method has been renamed to Psl\Result\ResultInterface::getThrowable()
BC - Psl\Result\wrap function now catches all Throwables instead of only Exceptions
introduced a new Psl\Result\reflect function
BC - Psl\Shell\escape_argument function has been removed, Shell\execute arguments are now always escaped.
BC - $escape_arguments argument of Shell\execute function has been removed.
introduced a new Psl\Shell\ErrorOutputBehavior enum
added a new $error_output_behavior argument to Shell\execute function, which can be used to return the command error output content, as well as the standard output content.
introduced a new Psl\Shell\unpack function to unpack packed result of Shell\execute ( see Psl\Shell\ErrorOutputBehavior::Packed ).
introduced a new Psl\Shell\stream_unpack function to unpack packed result of Shell\execute chunk by chunk, maintaing order ( see Psl\Shell\ErrorOutputBehavior::Packed ).
chore(io): improve resource handle performance by @azjezz in 7e438a3db4e8baee2da1d7ad2b20809e0589aa58
Full Changelog: https://github.com/azjezz/psl/compare/2.0.0-rc1...2.0.0-rc2
chore: remove deprecated functions by @azjezz in https://github.com/azjezz/psl/pull/241
Psl\Filesystem\write_file, Psl\Filesystem\append_file, and Psl\Filesystem\read_file to use Psl\File component. by @azjezz in https://github.com/azjezz/psl/pull/251Shell\execute to use async streams by @azjezz in https://github.com/azjezz/psl/pull/252await_readable, await_writable, await_signal, and wrap functions by @azjezz in https://github.com/azjezz/psl/pull/305readImmediately to tryRead, and writeImmediately to tryWrite by @azjezz in https://github.com/azjezz/psl/pull/314Full Changelog: https://github.com/azjezz/psl/compare/1.9.2...2.0.0-rc1
fix(composer): add Psl namespace mapped to src/Psl by @asgrim in https://github.com/azjezz/psl/pull/311
Psl namespace mapped to src/Psl by @asgrim in https://github.com/azjezz/psl/pull/311Full Changelog: https://github.com/azjezz/psl/compare/1.9.2...1.9.3
fix(filesystem): call clearstatcache after writing to a file to reset file stat by @dragosprotung in https://github.com/azjezz/psl/pull/262
Full Changelog: https://github.com/azjezz/psl/compare/1.9.1...1.9.2
chore(php): fix PHP 8.1 deprecations by @azjezz in https://github.com/azjezz/psl/pull/255
Full Changelog: https://github.com/azjezz/psl/compare/1.9.0...1.9.1
[Str] add reverse() function ( #238 by @yivi )
Features:
- [Str] add reverse() function ( #238 by @yivi )
- [Str][Grapheme] add reverse() function ( #239 by @yivi )
- [Fun] add tap() function ( #234 by @veewee )
- [Type] performance improvements ( #223 by @Ocramius )
Other: - add benchmarks ( #223 by @Ocramius ) - add documentation functions to makefile ( #235 by @veewee )
chore(php): fix PHP 8.1 deprecations by @azjezz in https://github.com/azjezz/psl/commit/346978e07e188ba7d2186b3bca1a622539b5830e
Full Changelog: https://github.com/azjezz/psl/compare/1.8.1...1.8.2
[Shell] fixed missing shell output from exception message ( #232 by @azjezz )
Features:
Fixes:
Other:
[Type] Introduce new Type\non_empty_dict ( #200 by @ntzm )
Features:
Type\non_empty_dict ( #200 by @ntzm )Type\non_empty_vec ( #201 by @ntzm )vec ( #202 by @ntzm )dict ( #203 by @ntzm )Iter\shuffle ( https://github.com/azjezz/psl/commit/6f5c992f4054ad08449cd170d18060d4e5c620b6 by @azjezz )Psl\Ref class ( https://github.com/azjezz/psl/commit/2d0b3c537a4685f123b9019975ef64d858fa2d7b by @azjezz )Fixes:
Vec\reproduce ( #218 by @hvt )Other:
php-standard-library/psalm-plugin package ( #217 by @weirdan )chore(php): fix PHP 8.1 deprecations by @azjezz in https://github.com/azjezz/psl/commit/f4c9a191e87f62059117bf183d1010e50c389b44
Full Changelog: https://github.com/azjezz/psl/compare/1.7.3...1.7.4
[Str][Byte] remove unnecessary @var annotation
fixed mismatching psalm assert variables #197 ( thanks to @dragosprotung )
One column per quarter.