Thursday, 19 November 2026

Trusted News Discovery – Powered by AI and Verified by Humans

PHP 8.6 released: partial function application, a nanosecond Duration class and clamp() arrive

PHP 8.6 was released on November 19, 2026, adding partial function application, a Time\Duration class, a polling API and a clamp() function.

Produced with AI assistance and reviewed by the Badiyaa Editorial Desk. How we work.

Verified by humans. Checked by machines. Open to you.

Grok Fact CheckCheck it yourself in one tapVerify with Grok ↗Ask @grok on X ↗
Colorful lines of program source code on a computer monitor, shown as an illustration of programming.
Image: Markus Spiske, CC0 via Wikimedia Commons

PHP 8.6.0 shipped on November 19, 2026, and the headline change lets developers fill in some of a function’s arguments now and the rest later. The PHP project calls it partial function application, and it arrives alongside a nanosecond-precise Duration class, a native polling API and a long-requested clamp() function.

The PHP 8.6 release announcement on php.net bills the update as a major release of the language. The changes touch everyone who writes or runs PHP code, from WordPress hosts to framework authors.

Partial function application

A call such as version_compare(?, ‘8.6’, ‘>=’) no longer runs immediately. The question mark marks a slot to be filled later, and PHP hands back a Closure that waits for the missing value. A trailing … placeholder stands in for every remaining argument. In practice this removes a lot of throwaway arrow functions written only to pin one parameter, for example when passing a callback to array_filter().

The project also says array_map() calls that use first-class callables or partial application are now compiled into plain loops, one of several speedups listed with faster printf() and JSON encoding.

Time, polling and a tidy clamp()

The new Time\Duration class stores elapsed time independently of any clock or time zone. According to the announcement it spans more than 250 years at nanosecond resolution, which suits timeouts, retry back-off and benchmark numbers that used to be juggled as raw microsecond integers.

The Io\Poll API watches many network streams at once using whatever each operating system does best: epoll on Linux, kqueue on BSD and macOS, event ports or WSAPoll elsewhere. It replaces the scaling ceiling of the old stream_select() and is pitched as a shared base for event-loop libraries such as ReactPHP and AMPHP.

Smaller additions round it out:

  • clamp() keeps a value inside a minimum and maximum, replacing the nested max(min()) idiom
  • a built-in SortDirection enum with Ascending and Descending cases
  • readonly properties may now declare default values
  • parameters can carry their own doc comments, readable through reflection
  • the Sodium extension gains post-quantum key encapsulation with X-Wing and ML-KEM-768

What breaks, and the safer defaults

Sessions get stricter out of the box: strict mode and HttpOnly cookies are switched on, and the SameSite cookie attribute defaults to Lax. A return statement inside a finally block is now deprecated, as are the mbstring regex functions such as mb_ereg(), because the Oniguruma library underneath is no longer maintained. Old aliases including is_double() and doubleval() are on the way out too.

Share this story

Badiyaa’s upgrade calendar

The dates matter more than the features for anyone running a site. Under the PHP supported versions schedule, every branch gets two years of active fixes and two more of security-only patches. That puts PHP 8.6’s active support end at December 31, 2028 and its security cutoff at December 31, 2030. The more urgent date sits closer: PHP 8.2 reaches end of life on December 31, 2026, roughly six weeks after this release, and PHP 8.4 leaves active support the same day. Sites still on 8.2 have until New Year’s Eve before security fixes stop.

Open-source maintainers have had a busy week. We also covered the seven memory bugs Ruby patched in its regex engine and the nginx flaw that let attackers run code without logging in.

The next feature branch, PHP 8.7, is expected to follow the same late-November rhythm in 2027.

Sources

Image: Markus Spiske, CC0 via Wikimedia Commons

This article was produced with AI assistance and reviewed by our Editorial Desk. How we work.

Spot an error? Help verify this story

Join our Reader Verifiers. Every report is read by an editor.

Grok Fact CheckCheck it yourself in one tapVerify with Grok ↗Ask @grok on X ↗

Verified by humans. Checked by machines. Open to you.