PHP 8.6 is due on 19 November UTC, and the PHP Foundation marked the day on X with six headline changes: partial function application, a Time\Duration class, a polling API, a clamp() function, a SortDirection enum and default values for readonly properties. PHP’s release page lists all six and still described 8.6 as not yet released when I read it.
The date runs into Friday morning in New Zealand. PHP’s security releases for the supported branches are scheduled for 14:00 to 14:30 UTC, which is 3:00am to 3:30am NZDT on 20 November, and PHP hasn’t published a time for 8.6.0 itself. My report on those security releases covers what they fix.
🎉 It’s PHP 8.6 Release Day!
— The PHP Foundation (@ThePHPF) November 19, 2026
See what’s new in this release already:
* Partial Function Application
* New \Time\Duration class
* Polling API
* New clamp() Function
* New SortDirection Enum
* Readonly Property Defaults
👓 Read more about it: https://t.co/0ZGCC16pIS #PHP #PHP86
Partial application and a Duration class
Partial function application lets you call a function with some arguments filled in and a ? where the rest go. You get a Closure back, which is a function stored in a variable, and the original function only runs once you pass the missing values. In php.net’s example, the callback for array_filter() shrinks to version_compare(?, '8.6', '>='). The RFC is by Larry Garfield and Arnaud Le Blanc.

Time\Duration is a class for elapsed time as a stopwatch measures it. php.net says it’s independent of any time or timezone and covers more than 250 years with nanosecond precision. The PHP Foundation’s blog, by Tim Düsterhus, says the standard library already expresses a length of time as seconds in sleep(), milliseconds in CURLOPT_TIMEOUT_MS, microseconds in usleep(), nanoseconds in hrtime(), a pair of integers in stream_set_timeout() and a float in microtime(true). The new polling API is the first to accept a Duration.

Düsterhus describes Duration as the first building block of a new date and time API. A Time\Instant and Time\Clock RFC, which adds points in time and a clock interface for testing, is under discussion on PHP’s internals list.
A polling API for event loops
The new Io\Poll API watches many streams at once using whichever mechanism the platform has: epoll, kqueue, event ports or WSAPoll. php.net says it avoids the scalability limits of stream_select(), and its example notes that select() typically can’t handle more than 1,024 connections. PHP positions it as a base for event loop libraries such as ReactPHP and AMPHP. Jakub Zelenka wrote the RFC, and the PHP Foundation’s blog says it came out of the Streams Project.

Three smaller additions
clamp() returns the value if it sits inside a range and the nearest boundary if it doesn’t, so php.net’s clamp(110, 0, 100) returns 100. It works on any comparable value, including a Duration. The SortDirection enum has two cases, Ascending and Descending. Düsterhus says a GitHub search found more than 150 incompatible enums with that name, which is the case he makes for putting one in PHP itself.
Readonly properties can now carry a default value, and the constructor can’t overwrite it. A readonly class can then satisfy a get-only interface property without writing a constructor, as php.net shows:
final readonly class SlugRule implements Rule
{
public string $parser = SlugParser::class;
}
The release page adds structured stream errors that can throw a StreamException, doc comments on parameters, post-quantum key encapsulation in the Sodium extension (X-Wing and ML-KEM-768), TLS session resumption and faster JSON encoding.
What can break an upgrade
Test the sessions change first. PHP 8.6 turns on session.use_strict_mode and session.cookie_httponly by default and sets session.cookie_samesite to Lax. trim(), ltrim() and rtrim() now strip form feed characters, and fclose(), file_put_contents() and copy() return false when flushing or closing a stream fails. Several functions now throw a ValueError for out-of-range values or strings containing NUL bytes where they used to carry on.

The deprecations include the mb_ereg() and mb_split() family, because the Oniguruma library behind them is no longer maintained; return inside a finally block; the is_double(), is_long(), is_integer() and doubleval() aliases; and spl_object_hash() in favour of spl_object_id(). Using let or is as a class, function or constant name is deprecated too. PHP’s migration guide has the full list, and the changelog will show the 8.6.0 entry once it ships.
Discover more from Sulat AI & Tech News
Subscribe to get the latest posts sent to your email.




