> TeamDevDesign
What are you looking for?

Explore our services and discover how we can help you achieve your goals

What's New in PHP 8.6? Features and Upgrade Notes
  1. Home

  2. Laravel

  3. What's New in PHP 8.6? Key Features and Website Upgrade Notes (2026)

What's New in PHP 8.6? Key Features and Website Upgrade Notes (2026)

PHP 8.6 was released on 19 November 2026: Partial Function Application, Duration, Polling API, clamp(), SortDirection and safer sessions. Deprecations and how to upgrade your website safely.

Team Dev Design
Team Dev Design

7 mins to read
What's New in PHP 8.6? Key Features and Website Upgrade Notes (2026)
Contents

On 19 November 2026, the PHP development team officially released PHP 8.6. This is the annual major update of the language that powers most websites in the world, from WordPress to Laravel. It brings a new function-call syntax, a time class precise to the nanosecond, an API for watching many connections at once and, notably, safer session configuration by default.

What's new in PHP 8.6, and should you upgrade right away? In this article, TeamDevDesign summarizes the main features of PHP 8.6, the changes that may break older websites, the support schedule of PHP versions and a safe upgrade process for business websites.

Table of contents

  • Key new features in PHP 8.6
  • Safer sessions by default
  • Deprecated functions and backward-incompatible changes
  • PHP version support schedule
  • Should you upgrade to PHP 8.6 right away?
  • A safe upgrade process
  • Frequently asked questions (FAQ)

1. What's new in PHP 8.6? Key features

Partial Function Application – calling functions with "pre-filled" arguments

You can fill in some of a function's arguments in advance and leave the rest open with a ? placeholder (or ...), getting a new function back. An example from the PHP release page:

version_compare(?, '8.6', '>='),

This makes array-processing and callback code shorter, without verbose closures.

The \Time\Duration class – precise time measurement

The new \Time\Duration class represents elapsed time "as measured by a stopwatch", precise to the nanosecond and independent of time zones. It is very useful for timeouts, retries and performance measurement:

Duration::fromSeconds(1),
$delay = $baseDelay->add($step->multiplyBy(2 ** $attempt));

Polling API (Io\Poll)

The new API lets you watch many connections (streams) at once using operating system mechanisms such as epoll, kqueue, event ports or WSAPoll, without the scalability limits of stream_select(). It lays the foundation for asynchronous libraries and WebSocket servers written in PHP.

The clamp() function and the SortDirection enum

The clamp() function keeps a value within a range – something that previously had to be written with min(max(...)):

var_dump(clamp(-10, 0, 100)); // int(0)
var_dump(clamp(110, 0, 100)); // int(100)

The SortDirection enum (Ascending, Descending) lets you pass a sort direction in a type-safe way instead of the strings 'asc' and 'desc'.

New PHP 8.6 features: Partial Function Application, Duration, clamp
Key features in PHP 8.6

Other improvements

  • Default values for readonly properties, including in readonly classes.
  • New URL builder classes: Uri\Rfc3986\UriBuilder, Uri\WhatWg\UrlBuilder.
  • JSON error messages that point to the exact error location; stream error handling with exceptions.
  • The #[\Override] attribute can be used on class constants and enum cases.
  • Several performance improvements.

2. Safer sessions by default

According to the official release page, starting with PHP 8.6 the following session settings are enabled by default:

SettingBefore PHP 8.6PHP 8.6Effect
session.use_strict_mode0 (off)1 (on)Rejects session IDs set by an attacker
session.cookie_httponly0 (off)1 (on)JavaScript cannot read the session cookie
session.cookie_samesiteNot setLaxReduces the risk of CSRF attacks
PHP 8.6 enables safer session configuration by default
Sessions in PHP 8.6 are better protected right from the default configuration

For plain PHP websites or custom code that uses $_SESSION, this is a security win, but you should re-test login, shopping cart and cross-domain iframe embedding features. Laravel manages its own session cookies, so it is less affected. See common mistakes in the article on PHP security vulnerabilities.


3. Deprecated functions and backward-incompatible changes

Deprecated means the code still runs but emits a warning and may be removed in a later major version. Some notable items in PHP 8.6:

  • return inside a finally block.
  • Returning a value from __construct() or __destruct().
  • mbstring regex functions such as mb_ereg(), mb_split() (the Oniguruma library is no longer maintained).
  • The alias functions is_double(), is_long(), is_integer(), doubleval().
  • spl_object_hash() – switch to spl_object_id().
  • The third parameter of define(), the strcoll() function, the SORT_LOCALE_STRING flag, the metaphone() function.
  • Custom session handlers that do not implement create_sid() and validateId().

Backward-incompatible changes to check carefully:

  • trim(), ltrim(), rtrim() now also strip the form feed character (\f) by default.
  • fclose(), file_put_contents(), copy() return false when writing or closing a file fails.
  • Many functions throw ValueError when given out-of-range values, invalid flags or strings containing NUL bytes.
Checking compatibility before upgrading a website to PHP 8.6
Check old code before upgrading to avoid errors on the live website

4. PHP version support schedule

Each PHP version gets 2 years of full support, followed by 2 more years of security fixes only. According to php.net:

VersionReleasedFull support untilSecurity fixes until
PHP 8.28 December 202231 December 202431 December 2026
PHP 8.323 November 202331 December 202531 December 2027
PHP 8.421 November 202431 December 202631 December 2028
PHP 8.520 November 202531 December 202731 December 2029
PHP 8.619 November 202631 December 202831 December 2030

Important: PHP 8.2 reaches end of security support on 31 December 2026. If your website runs PHP 8.2 or older, now is the time to plan an upgrade – not necessarily straight to 8.6; PHP 8.4 or 8.5 is a more stable choice.


5. Should you upgrade to PHP 8.6 right away?

For a website that is actively doing business, do not upgrade in the first few weeks. WordPress plugins, themes and Laravel packages need time to become compatible. Practical advice:

  • WordPress websites: check whether each plugin and theme lists PHP 8.6 support; prefer running a stable PHP 8.4/8.5.
  • Laravel websites: check whether your Laravel version and the packages in composer.json support PHP 8.6 before switching.
  • New projects: you can start with PHP 8.6 if every library you need already supports it.

6. A safe PHP upgrade process

  1. Back up all source code and the database.
  2. Set up a staging copy running the new PHP version, keeping the live website on the old version.
  3. Turn on deprecation warnings on staging and walk through the main features: login, contact form, shopping cart, checkout, image upload.
  4. For Laravel: run composer update on staging along with the full test suite; for WordPress: update plugins and themes first.
  5. Read the error logs and fix code according to the deprecation list above.
  6. Switch the PHP version on the live website during low-traffic hours, monitor logs for 24–48 hours and be ready to roll back to the old version.

If you don't have time to do it yourself, TeamDevDesign's website maintenance and management service can help with compatibility checks and a safe PHP upgrade.


Frequently asked questions (FAQ)

Calling functions with pre-filled arguments (Partial Function Application), the Duration class, the Polling API, the clamp() function, the SortDirection enum, default values for readonly properties and safer sessions by default.

PHP 8.6 was officially released on 19 November 2026, with full support until 31 December 2028 and security fixes until 31 December 2030.

PHP 8.6 includes some performance improvements, but the gain depends on your code. Slow websites are usually caused by hosting, images, database queries and plugins rather than the PHP version.

After 31 December 2026, PHP 8.2 no longer receives security fixes. The website will keep running, but the risk of vulnerabilities being exploited grows over time, so plan an upgrade to PHP 8.4 or newer.

It depends on the provider. Most hosting services and control panels such as aaPanel will add PHP 8.6 within a few weeks. You can read how to choose infrastructure in the article comparing hosting and VPS.


Conclusion

PHP 8.6 is a worthwhile update with Partial Function Application, Duration, the Polling API, clamp() and safer sessions by default. However, for a website that is actively doing business, upgrade according to a plan: test compatibility on staging and prioritize moving off PHP 8.2 before 31 December 2026. Need help upgrading? Contact TeamDevDesign.

Sources: PHP 8.6 Release Announcement and the Supported Versions page on php.net.

Illustrations in this article were created with AI tools.

Share this post:

Contents
Related Posts
Laravel Rust and Laravel Go Launch: What's New, Should You Use Them Now? (2026)
Laravel Laravel Rust and Laravel Go Launch: What's New, Should You Use Them Now? (2026)

Laravel launches Laravel Rust (1 December 2026) and Laravel Go (2 December 2026) in beta: features,...

dots Get new articles on web design, SEO and running a website.

Subscribe to our newsletter!

Weekly web design trends, SEO tips and practical ideas for growing your business online.

icon
icon
Live Chat
Live Chat Offline

Hi there! How can we help you today?

Powered by FOB Live Chat