Hi there! How can we help you today?
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.
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'.

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:
| Setting | Before PHP 8.6 | PHP 8.6 | Effect |
|---|---|---|---|
| session.use_strict_mode | 0 (off) | 1 (on) | Rejects session IDs set by an attacker |
| session.cookie_httponly | 0 (off) | 1 (on) | JavaScript cannot read the session cookie |
| session.cookie_samesite | Not set | Lax | Reduces the risk of CSRF attacks |

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:
returninside afinallyblock.- 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 tospl_object_id().- The third parameter of
define(), thestrcoll()function, theSORT_LOCALE_STRINGflag, themetaphone()function. - Custom session handlers that do not implement
create_sid()andvalidateId().
Backward-incompatible changes to check carefully:
trim(),ltrim(),rtrim()now also strip the form feed character (\f) by default.fclose(),file_put_contents(),copy()returnfalsewhen writing or closing a file fails.- Many functions throw
ValueErrorwhen given out-of-range values, invalid flags or strings containing NUL bytes.

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:
| Version | Released | Full support until | Security fixes until |
|---|---|---|---|
| PHP 8.2 | 8 December 2022 | 31 December 2024 | 31 December 2026 |
| PHP 8.3 | 23 November 2023 | 31 December 2025 | 31 December 2027 |
| PHP 8.4 | 21 November 2024 | 31 December 2026 | 31 December 2028 |
| PHP 8.5 | 20 November 2025 | 31 December 2027 | 31 December 2029 |
| PHP 8.6 | 19 November 2026 | 31 December 2028 | 31 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
- Back up all source code and the database.
- Set up a staging copy running the new PHP version, keeping the live website on the old version.
- Turn on deprecation warnings on staging and walk through the main features: login, contact form, shopping cart, checkout, image upload.
- For Laravel: run
composer updateon staging along with the full test suite; for WordPress: update plugins and themes first. - Read the error logs and fix code according to the deprecation list above.
- 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 launches Laravel Rust (1 December 2026) and Laravel Go (2 December 2026) in beta: features,...