PHP 8.6 is scheduled for general availability on November 19, 2026, and it's shaping up to be one of the most feature-rich releases in recent memory. The release is currently in beta, with a feature freeze on September 22 and RC 1 on September 24. Release managers are Daniel Scherzer, Matteo Beccati, and Joe Ferguson.
Here's a rundown of every significant addition.
Partial Function Application
Partial function application (PFA) lets you pre-fill some arguments of a function and receive a closure that accepts the rest. Use ? as a placeholder for a single argument, or ... for all remaining arguments:
$makeSlug = str_replace(' ', '-', ?);
$makeSlug('Hello World'); // Hello-World
$titles = array_map(strtolower(?), $titles);
Arguments supplied at creation time are evaluated immediately, not at call time. Every ? placeholder becomes a required parameter on the resulting closure, even if the original parameter was optional. The v2 RFC passed 33–0.
The clamp() Function
The new clamp() function constrains a value between a minimum and maximum, replacing the error-prone min(max($value, $min), $max) pattern:
clamp(10, min: 0, max: 100); // 10
clamp(101, min: 0, max: 100); // 100
clamp(-1, min: 0, max: 100); // 0
It works with any comparable type, including strings and DateTime objects. Passing $min > $max throws a ValueError.
A Duration Class
Time\Duration is a new final readonly class representing a length of time with nanosecond precision. It supports factory methods, arithmetic, ISO 8601 strings, and comparison operators:
use Time\Duration;
$oneSecond = Duration::fromSeconds(1);
$halfSecond = $oneSecond->divideBy(2);
$total = $oneSecond->add($halfSecond);
$delay = Duration::fromMilliseconds(100)->multiplyBy(2 ** $attempt);
$total > $delay; // comparison operators work
The class is designed as a shared type for core functions and the new polling API.
Readonly Property Defaults
Readonly properties can now carry a default value — previously a compile-time error:
final readonly class CreateBooksTable implements Migration
{
public string $name = '2026_01_01_create_books_table';
}
Readonly semantics are unchanged; the property still cannot be reassigned after initialization.
DocComments for Function Parameters
Doc comments can now be placed directly on individual parameters, and ReflectionParameter::getDocComment() returns them:
function search(
/** Terms to search for in the database */
string $query,
/** Maximum number of entries to return */
int $limit = 10,
): array {}
A Polling API
The Io\Poll namespace provides a unified interface to platform-native polling (epoll, kqueue, WSAPoll). It replaces stream_select() for event loops and async runtimes:
use Io\Poll\{Context, Event, StreamPollHandle};
$poll = new Context();
$server = stream_socket_server('tcp://0.0.0.0:8080');
stream_set_blocking($server, false);
$poll->add(new StreamPollHandle($server), [Event::Read], ['type' => 'server']);
while (true) {
foreach ($poll->wait(1) as $watcher) {
if ($watcher->hasTriggered(Event::Read)) {
// accept the connection
}
}
}
Other Notable Additions
SortDirectionenum — a built-inAscending/Descendingenum so libraries stop defining their own.- Enums can implement
__debugInfo()— customizevar_dump()output on backed enums. - Stream error handling — a new
error_modecontext option andStreamExceptionreplace scattered warnings. - URI builder classes — fluent
UriBuilderadded to the URI extension introduced in PHP 8.5. - Secure session defaults —
session.use_strict_mode,session.cookie_httponly, andsession.cookie_samesiteall default to safer values on new installations. Laravel-managed sessions are unaffected.
Key Takeaways
- Partial function application finally lands after a 2021 rejection, passing 33–0 on the second attempt.
clamp()eliminates a common, easy-to-get-wrong pattern.Time\Durationgives the ecosystem a standard type for time lengths.- The polling API lays groundwork for better async support in PHP's core.
- Readonly properties with defaults unblock interface patterns introduced in PHP 8.4.
- Session security defaults improve out-of-the-box safety for apps not using a framework.