What's New in PHP 8.6 – Features &amp; Changes | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    What's New in PHP 8.6: Every Feature You Need to Know        On this page       1. [  Partial Function Application ](#partial-function-application)
2. [  The clamp() Function ](#the-clamp-function)
3. [  A Duration Class ](#a-duration-class)
4. [  Readonly Property Defaults ](#readonly-property-defaults)
5. [  DocComments for Function Parameters ](#doccomments-for-function-parameters)
6. [  A Polling API ](#a-polling-api)
7. [  Other Notable Additions ](#other-notable-additions)
8. [  Key Takeaways ](#key-takeaways)

  ![What's New in PHP 8.6: Every Feature You Need to Know](https://cdn.msaied.com/671/4d84541d3dfb8c0d442b22cb158658ec.png)

 [  PHP ](https://msaied.com/articles?category=php)  #PHP 8.6   #PHP   #New Features   #Laravel   #Backend Development  

 What's New in PHP 8.6: Every Feature You Need to Know 
=======================================================

     15 Sep 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said  

       Table of contents

1. [  01   Partial Function Application  ](#partial-function-application)
2. [  02   The clamp() Function  ](#the-clamp-function)
3. [  03   A Duration Class  ](#a-duration-class)
4. [  04   Readonly Property Defaults  ](#readonly-property-defaults)
5. [  05   DocComments for Function Parameters  ](#doccomments-for-function-parameters)
6. [  06   A Polling API  ](#a-polling-api)
7. [  07   Other Notable Additions  ](#other-notable-additions)
8. [  08   Key Takeaways  ](#key-takeaways)

 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:

```php
$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:

```php
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:

```php
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:

```php
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:

```php
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:

```php
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
-----------------------

- **`SortDirection` enum** — a built-in `Ascending`/`Descending` enum so libraries stop defining their own.
- **Enums can implement `__debugInfo()`** — customize `var_dump()` output on backed enums.
- **Stream error handling** — a new `error_mode` context option and `StreamException` replace scattered warnings.
- **URI builder classes** — fluent `UriBuilder` added to the URI extension introduced in PHP 8.5.
- **Secure session defaults** — `session.use_strict_mode`, `session.cookie_httponly`, and `session.cookie_samesite` all 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\Duration` gives 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.

---

*Source: [What's New in PHP 8.6 — Laravel News](https://laravel-news.com/php-8-6)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fwhats-new-in-php-86-every-feature-you-need-to-know&text=What%27s+New+in+PHP+8.6%3A+Every+Feature+You+Need+to+Know) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fwhats-new-in-php-86-every-feature-you-need-to-know) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  When is PHP 8.6 released?        PHP 8.6 is scheduled for general availability on November 19, 2026. The feature freeze is September 22, 2026, and RC 1 ships September 24, 2026. 

      Q02  Does PHP 8.6's new secure session defaults affect Laravel applications?        No. Laravel manages its own session cookies independently of php.ini session settings, so the new defaults for session.use_strict_mode, session.cookie_httponly, and session.cookie_samesite do not affect most Laravel apps. Only applications using native PHP sessions and relying on the old defaults need to review the change. 

      Q03  What is partial function application in PHP 8.6 and how does it work?        Partial function application lets you call a function with some arguments pre-filled and receive a closure for the rest. Use ? as a placeholder for each argument you want to supply later. Pre-filled arguments are evaluated at creation time, and every ? placeholder becomes a required parameter on the resulting closure. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Livewire v4.4.5 Released: wire:navigate Fixes, JSON Session Support & More](https://cdn.msaied.com/670/91719b0682698004adbe722a8085269d.png) Livewire Laravel PHP 

### Livewire v4.4.5 Released: wire:navigate Fixes, JSON Session Support &amp; More

Livewire v4.4.5 ships nine targeted fixes and backports, including JSON session serialization, improved wire:n...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 14 Sep 2026     3 min read  

  Read    

 ](https://msaied.com/articles/livewire-v445-released-wirenavigate-fixes-json-session-support-more) [ ![Laravel Concurrency Facade and Process Pools for Parallel Work](https://cdn.msaied.com/667/241195c7a202f534b71ced2e321e27b5.png) laravel concurrency performance 

### Laravel Concurrency Facade and Process Pools for Parallel Work

Laravel's Concurrency facade and process pools let you run independent tasks in parallel without reaching for...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 14 Sep 2026     3 min read  

  Read    

 ](https://msaied.com/articles/laravel-concurrency-facade-and-process-pools-for-parallel-work-4) [ ![Job Batching, Chaining, and Catch Callbacks: Reliable Async Workflows in Laravel](https://cdn.msaied.com/666/f8aaa3879dc7efd419291ffa3e0b15c1.png) laravel queues async 

### Job Batching, Chaining, and Catch Callbacks: Reliable Async Workflows in Laravel

Go beyond fire-and-forget jobs. Learn how to compose Laravel job batches, chains, and catch callbacks into rel...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 13 Sep 2026     4 min read  

  Read    

 ](https://msaied.com/articles/job-batching-chaining-and-catch-callbacks-reliable-async-workflows-in-laravel) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
