PHP 8.6 was released on 19 November 2026, and it is a developer-focused release. The headline features are partial function application, a new clamp() function, a Time\Duration class and a new polling API, alongside safer session cookie defaults and a long list of deprecations ahead of PHP 9. Nothing was removed outright, but the session changes and deprecation notices are the parts most likely to affect a live site.
This article is for business owners, agencies and in-house teams who run PHP sites on WordPress, WooCommerce, Laravel or custom code. Each section explains a change in plain words, shows a few lines of code only where it helps, and ends with what it means for you.
PHP 8.6 release date and status
PHP 8.6 follows the usual yearly cycle. The PHP 8.6 release schedule (opens in a new tab) planned alphas from 2 July 2026, betas from 13 August and release candidates from late September, with general availability on 19 November 2026.
PHP 8.6.0 arrived on that date. The release announcement on php.net (opens in a new tab) names the same headline features covered below, and the supported versions page (opens in a new tab) gives PHP 8.6 active support until 31 December 2028 and security fixes until 31 December 2030. On the same day, PHP shipped security releases for older versions (8.5.13, 8.4.28, 8.3.37 and 8.2.36), so a site does not need to jump to 8.6 to stay patched.
Everything in this article comes from the official PHP 8.6 UPGRADING notes (opens in a new tab) on the PHP-8.6 branch and the implemented proposals in the PHP RFC list (opens in a new tab). An RFC (request for comments) is the formal proposal and vote behind each change.
What it means for you: a release date is when PHP itself is ready, not when your hosting, plugins or framework support it. Expect hosts and plugin authors to catch up over the following weeks and months.
New language features
PHP 8.6 adds new ways to write code. None of them changes how existing code runs.
Partial function application
Partial function application lets a developer fill in some of a function's arguments now and leave the rest for later. A ? stands for one missing argument and ... for any remaining ones. Instead of running, the call returns a small reusable function. The partial function application RFC (opens in a new tab) passed 33 votes to 0.
$isAllowed = in_array(?, $allowedCountries, strict: true);
$isAllowed('IN'); // true or falseBefore 8.6, the same thing needed a short wrapper function.
What it means for you: shorter, tidier code in new projects. It has no effect on an existing site until someone writes code that uses it, and code that does will not run on PHP 8.5 or older.
Readonly properties with default values
A readonly property is a value that cannot change after it is set. In PHP 8.6 it can now have a default value written directly in the class, which counts as its one and only assignment.
final class InvoiceSettings
{
public readonly string $currency = 'INR';
}What it means for you: a small convenience for developers writing settings and value objects. No action needed.
New functions and classes
PHP 8.6 adds several built-in tools that used to need custom code or a library. The most useful for everyday business code are listed here.
clamp()
clamp() keeps a number inside a range. If the value is too low it returns the minimum, if too high it returns the maximum, otherwise the value itself. It throws an error if the minimum is greater than the maximum.
$quantity = clamp($requested, min: 1, max: 10);What it means for you: a common rule in shops and forms, such as order limits or discount caps, becomes one clear line. Plugins that already define their own function named clamp() without a namespace could clash with the new built-in one, so ask your developer to check.
Time\Duration
Time\Duration is a new class for lengths of time, such as timeouts, retry delays and session lengths. It works in nanoseconds, ignores time zones and calendar dates, and supports adding, subtracting, multiplying, dividing and comparing durations.
use Time\Duration;
$timeout = Duration::fromSeconds(30);
$retryAfter = $timeout->divideBy(2);What it means for you: fewer bugs where seconds and milliseconds get mixed up, which matters for payment and API timeouts. It is new code, so it only helps once developers adopt it.
Polling API and stream errors
The new Io\Poll classes let PHP watch many network connections at once using the fastest method the server supports. Until now PHP only had stream_select(). PHP 8.6 also adds a new stream errors API, so network and file errors can be handled as structured errors instead of plain warnings.
What it means for you: mostly relevant to frameworks and tools that run long-lived processes, such as queues and real-time features. A typical WordPress site will not notice it.
Other additions
- SortDirection enum: a standard way to say ascending or descending. In 8.6 no built-in function uses it yet.
- mysqli_quote_string(): a new MySQLi function to quote a string for a query.
- grapheme_strrev(): reverses text safely in languages with combined characters, such as Hindi.
What it means for you: small quality gains for developers. Nothing to do unless your team wants to use them.
Notable changes that can affect a live site
These are the changes we would check first on any site moving to PHP 8.6, because they change how existing code behaves.
Safer session cookie defaults
The secure session defaults RFC (opens in a new tab) changed three settings that control the login and basket cookie PHP creates:
| Setting | Before 8.6 | From 8.6 | Effect |
|---|---|---|---|
| session.use_strict_mode | 0 | 1 | Rejects session IDs PHP did not create |
| session.cookie_httponly | 0 | 1 | JavaScript can no longer read the session cookie |
| session.cookie_samesite | Not set | Lax | Cookie not sent on cross-site form posts |
This is good for security, but it can break flows that rely on the old behaviour. The RFC names single sign-on logins and cross-site form posts. A payment gateway that posts back to your site could also lose the visitor's session.
What it means for you: test logins, single sign-on and every payment return on staging. Plugins and custom apps that use PHP sessions are affected.
Stricter checks and other changes
- More ValueErrors: many functions now throw an error for invalid input, such as a NUL byte in a file name or an out-of-range number, where they used to warn or fail quietly.
- trim() also removes form feed characters by default.
- preg_grep() returns false on a regex error instead of a partial result.
- Function arguments in errors: a new
error_include_argssetting, off by default, shows the arguments passed to a function in error messages.
What it means for you: most well-written code is unaffected. Old or rushed custom code is where these show up, usually as a fatal error on one page or one task.
PHP 8.6 deprecations
A deprecation is a warning that something will be removed in a future version. Deprecated code still runs in PHP 8.6, but it writes a notice to the error log each time. The main list is in the Deprecations for PHP 8.6 RFC (opens in a new tab), and the upgrade notes add a few from separate RFCs.
| Deprecated in PHP 8.6 | Use instead |
|---|---|
| is_double(), is_long(), is_integer(), doubleval() | is_float(), is_int(), floatval() |
| spl_object_hash() | spl_object_id() |
| mb_ereg() and the other mbregex functions | preg functions, or the external mb_onig extension |
| strcoll() and SORT_LOCALE_STRING | The Collator class from intl |
| Passing objects to http_build_query() and array_walk() | Convert with get_object_vars() first |
| Third argument to define() | Remove it |
| return inside a finally block | Restructure the code |
| Returning a value from __construct() or __destruct() | Return nothing |
| mysqli_get_charset() and mysqli_stmt_init() | Alternatives named in the RFC |
| SplFileObject CSV methods, metaphone(), spl_classes() | Alternatives named in the RFC |
| Using let, is or _ as names for functions, classes or constants | Rename them |
The Oniguruma end-of-life RFC says the mbregex functions are deprecated because the library they rely on is no longer maintained, and that they are due to be removed in PHP 9.
What it means for you: deprecations will not take a site down, but they can fill error logs and, if errors are shown on screen, leak warnings onto pages. They are also a clear to-do list for code that will break in PHP 9. Older plugins and custom code are the usual source.
Removals and backward-incompatible changes
The "Removed Extensions and SAPIs" section of the official upgrade notes is empty for PHP 8.6, so no extension was taken out. The backward-incompatible changes are the session defaults and stricter checks above, plus smaller changes for specific extensions such as cURL callbacks, DOM read-only properties and ZipArchive serialisation.
What it means for you: PHP 8.6 is a gentler step than a major version. The risk sits in custom code and less-maintained plugins, not in PHP removing things you rely on.
Performance in PHP 8.6
The upgrade notes list performance work but give no overall speed figure. Named improvements include faster closures, cheaper printf() calls with simple formats, quicker JSON encoding and faster versions of common array and string functions.
What it means for you: the notes give no overall figure, so we would not plan around a speed gain.
PHP 8.6 at a glance
| Feature | What it does | Who should care |
|---|---|---|
| Partial function application | Pre-fills some arguments and returns a reusable function | Developers on new projects |
| Readonly property defaults | Lets a readonly property have a default value | Developers |
| clamp() | Keeps a number between a minimum and maximum | Shops and forms with limits |
| Time\Duration | Stores and calculates lengths of time | Apps with timeouts and retries |
| Io\Poll polling API | Watches many connections efficiently | Frameworks, queues, real-time apps |
| Secure session defaults | HttpOnly, SameSite=Lax and strict mode on by default | Any site using PHP sessions, logins or SSO |
| Stricter input checks | More ValueErrors for invalid arguments | Sites with old custom code |
| Deprecations | Warnings for functions due to go in PHP 9 | Anyone maintaining plugins or custom code |
| Performance work | Faster closures, JSON and array functions | Everyone, modestly |
Supported PHP versions and end-of-life dates
Support dates for every branch, including when PHP 8.6 is added, are on the supported versions page on php.net (opens in a new tab).
What it means for WordPress and WooCommerce sites
A WordPress or WooCommerce site is only ready for PHP 8.6 when WordPress core, WooCommerce, your theme and your key plugins say they support it. The session changes and deprecation notices above are the parts most likely to show up on a store or membership site. Test checkout, logins and forms on a staging copy before any switch. Our guide on whether your WordPress or WooCommerce site should upgrade to PHP 8.6 sets out the upgrade path step by step.
Custom code is where PHP upgrades go wrong
In our work, custom plugins and in-house apps are the code most often left behind.
A careful review runs the code on PHP 8.6 in a test environment, reads every deprecation notice, fixes the functions on the list above and checks any feature that uses PHP sessions. Our PHP and JavaScript development work covers this kind of review and update for custom PHP and Laravel code. For WordPress, the same applies to bespoke plugins, which is part of our WordPress plugin development service.
If you are weighing whether to keep an old custom plugin or replace it, our comparison of custom WordPress plugins and existing plugins helps with that decision.
A simple next step
Ask your developer to run your custom code on PHP 8.6 in a test copy and read every deprecation notice. If nobody looks after that code today, make it part of regular website maintenance and support.
Frequently asked questions
When was PHP 8.6 released?
PHP 8.6.0 was released on 19 November 2026, as planned in the release schedule. It gets active support until 31 December 2028 and security fixes until 31 December 2030.
What are the main new features in PHP 8.6?
The main ones are partial function application, default values for readonly properties, the clamp() function, the Time\Duration class and a new polling API. PHP 8.6 also turns on safer session cookie defaults and deprecates a long list of older functions.
Does PHP 8.6 remove anything?
No extension was removed in PHP 8.6, according to the official upgrade notes. Some functions are deprecated, which means they still work but log a warning and are expected to be removed in PHP 9.
Will PHP 8.6 make my website faster?
The upgrade notes list many small performance improvements. The notes give no overall figure, so we would not plan around a speed gain.
Sources
The facts in this article were checked against these pages, last reviewed 20 November 2026.
- PHP 8.6 release schedule, PHP Wikiwiki.php.net/todo/php86
- PHP 8.6.0 Released, PHP.netphp.net/archive/2026.php#2026-11-19-5
- Supported Versions, PHP.netphp.net/supported-versions.php
- PHP 8.6 UPGRADING notes, php-src on GitHubgithub.com/php/php-src/blob/PHP-8.6/UPGRADING
- Requests for Comments, PHP Wikiwiki.php.net/rfc
- Partial Function Application v2, PHP RFCwiki.php.net/rfc/partial_function_application_v2
- Secure Session Configuration Defaults, PHP RFCwiki.php.net/rfc/session_security_defaults
- Deprecations for PHP 8.6, PHP RFCwiki.php.net/rfc/deprecations_php_8_6
- Supported Versions, PHP.netphp.net/supported-versions.php




