Release date · November 19, 2026

PHP 8.6

Leave a ? now. Fill it in later.

Partial function application, a real Duration type, a modern polling API, clamp() and a long list of quality-of-life upgrades. Don't just read the changelog. Poke at it.

// $supportsPfa [2 => '8.6', 3 => '8.7', 4 => '9.0']
?  ...
Two placeholders turn any call into a closure
1 ns
Time\Duration precision, across a range of ~292 years
4
Native poll backends: epoll, kqueue, event ports, WSAPoll
0
Servers involved. Every demo here is simulated in your browser
01 · Language

Partial function application

Call a function with some arguments missing and PHP hands you back a Closure that is waiting for the rest. ? stands for exactly one argument, and a trailing ... stands for everything else. Bound arguments are evaluated once, when the partial is created.

RFC: Partial Function Application v2 ↗

Build a partial

Pick a function, then decide for each argument: bind a value, leave a ?, or don't write it at all.

Adds the variadic placeholder: “and whatever arguments are left”.
You write
PHP gives you the same thing as
Now call it

Made for the pipe operator

PHP 8.5's |> needs a callable that takes one argument. With ? you can aim the piped value at any parameter. Type something, toggle stages, reorder them.

? is new in 8.6 name(...) first-class callable, since 8.1
02 · Standard library

clamp()

No more max($min, min($max, $value)) and squinting at which bound goes where. clamp() returns the value if it is inside the range, and the nearest bound if it is not.

RFC: clamp() ↗
Anything comparable works
clamp(2.5, 1.3, 3.4);        // 2.5
clamp("a", "c", "g");        // "c"

clamp(
    new DateTimeImmutable('2025-08-01'),
    min: new DateTimeImmutable('2025-08-15'),
    max: new DateTimeImmutable('2025-09-15'),
)->format('Y-m-d');          // 2025-08-15
03 · Standard library

Time\Duration

Was that timeout in seconds, milliseconds or microseconds? Duration is an immutable stopwatch value with nanosecond precision, so the unit lives in the type instead of a comment. Durations are comparable, which means min(), max() and clamp() just work.

RFC: Duration class ↗

Retry back-off, by attempt

Delay before each retry: base plus a step that doubles every attempt, capped at 30 seconds.

Hover or focus a bar to inspect that attempt.
Show the data as a table
What's on the class
Duration::fromSeconds(1, nanoseconds: 500_000_000);
Duration::fromMilliseconds(250);
Duration::fromMinutes(5);
Duration::fromHours(1)->negate();

$d->add($other);      $d->sub($other);
$d->multiplyBy(3);    $d->divideBy(2);
$d->absolute();

$d->seconds;  $d->nanoseconds;  $d->negative;

usort($timings, Duration::compare(...));
04 · I/O

The Io\Poll API

stream_select() re-checks every stream each time it wakes up, and typically tops out around 1,024 descriptors. The new polling API asks the operating system instead and only hands back the streams that are actually ready. It is a building block for event loops like ReactPHP and AMPHP, not an event loop itself.

RFC: Polling API ↗
stream_select()scans everything
0streams checked per wake-up
0checked in total
Io\Poll\Contextonly what's ready
0streams handed back per wake-up
0handled in total

Conceptual illustration, not a benchmark. Each dot is a connection; yellow ones have data waiting.

An echo server on the new API

use Io\Poll\{Context, Event};

$server = stream_socket_server('tcp://0.0.0.0:8080');

$poll = new Context();   // picks epoll, kqueue, event ports or WSAPoll
$poll->add(new StreamPollHandle($server), [Event::Read]);

while (true) {
    foreach ($poll->wait() as $watcher) {
        $stream = $watcher->getHandle()->getStream();

        if ($stream === $server) {
            $client = stream_socket_accept($server);
            $poll->add(new StreamPollHandle($client), [Event::Read]);
            continue;
        }

        $data = fread($stream, 8192);

        if ($data === '' || $data === false) {
            $watcher->remove();
            fclose($stream);
        } else {
            fwrite($stream, $data);
        }
    }
}
05 · Quick hits

Five smaller wins, before and after

Not every feature needs a headline. These are the ones you'll quietly start using in the first week.

06 · Everything else

And there's more

Text that reverses properly, post-quantum crypto, safer sessions and a faster engine.

grapheme_strrev(): reverse what people see, not bytes

strrev() flips bytes, which shreds anything outside ASCII. The new function reverses whole grapheme clusters, so emoji and accents survive.

strrev($text)
grapheme_strrev($text)
07 · Upgrading

Will my code complain?

PHP 8.6 deprecates a batch of old aliases and footguns. Paste some PHP below for a quick first pass. It is a simple pattern match that runs entirely in your browser, so treat it as a hint and run a real static analyser before you upgrade.