PHP 8.6 Released with Partial Functions, Duration Class
Original: What's New in PHP 8.6
Why This Matters
Polling API and partial application close long-standing gaps for async and functional PHP patterns.
PHP 8.6 launched November 19, 2026, adding Partial Function Application, a new \Time\Duration class, a Polling API for scalable I/O, a clamp() function, SortDirection enum, and readonly property defaults.
PHP 8.6 arrives as a significant language update, shipping six headline features aimed at cleaner code and better I/O scalability.
Partial Function Application lets developers pre-fill some arguments of a function using `?` and `...` placeholders, returning a Closure. The remaining arguments are passed when the closure is invoked — cutting down boilerplate anonymous functions in common patterns like array_filter calls.
The new `\Time\Duration` class models elapsed time independently of any date, time zone, or calendar. It supports nanosecond precision and can represent spans exceeding 250 years, making it practical for benchmarks and timeouts.
The Polling API brings scalable I/O multiplexing — backed by epoll, kqueue, and other native OS mechanisms — directly into PHP's standard library. Event loop libraries like ReactPHP and AMPHP can now leverage this without custom C extensions.
Smaller but useful additions round out the release: `clamp()` constrains a value within a min/max range, the new `SortDirection` enum provides a type-safe standard for expressing sort order across libraries, and readonly properties can now declare default values, removing the need to set fixed values inside constructors.