The PHP team released PHP 8.6.0 on 19 November 2026, this year's feature release of the language. It adds a new way to pre-fill function arguments, better tools for time and stream handling, and changes several session defaults. This page summarises the official release page and the php.net news archive, and what they mean if you run a website or business system on PHP.
The short version
- PHP 8.6 is a feature release, not a security fix. Nothing forces a move this week.
- What matters now is being on the latest security patch of your current branch. We cover that on the PHP security updates page.
- Plan the move to 8.6 once your framework and key libraries declare support, and after testing on a staging copy.
- If you are still on PHP 8.2, its support ends on 31 December 2026. Leaving 8.2 matters more than waiting for 8.6.
The main new features
Partial function application
The headline feature lets you call a function with ? placeholders for the arguments you don't have yet. The result is a closure that runs once the missing arguments arrive. The example on the release page:
// PHP 8.5 and older
$filter = fn ($version) => version_compare($version, '8.6', '>=');
// PHP 8.6
$filter = version_compare(?, '8.6', '>=');
This is most useful in code that passes callbacks to array_map(), array_filter() and similar functions. The PHP team notes that array_map() with a first-class callable or a partial application now compiles to a plain loop, so it also runs faster.
A Duration class for elapsed time
\Time\Duration represents a measured span of time, independent of time zones, with nanosecond precision across more than 250 years. Instead of passing raw microseconds to usleep() and clamping them by hand, you build durations with fromSeconds() or fromMilliseconds() and add or multiply them.
A polling API for many connections
Io\Poll watches many open streams with the best mechanism each operating system offers: epoll on Linux, kqueue on BSD and macOS, event ports or WSAPoll elsewhere. It removes the limits of stream_select(). It is mainly a foundation for async libraries such as ReactPHP and AMPHP; most websites will not call it directly.
Stream errors you can catch
Stream operations can now throw a StreamException instead of emitting warnings. Each error is a structured object with an error code enum, the wrapper name and the path or URL. That replaces the old pattern of @ plus error_get_last().
Smaller additions
clamp()keeps a value inside a range, replacing nestedmax()andmin()calls.- A
SortDirectionenum withAscendingandDescending, so libraries can share one type for sort order. - Readonly properties can declare a default value inline.
- Each function parameter can carry its own doc comment, read through
ReflectionParameter::getDocComment(). mysqli::quote_string(), matchingPDO::quote().- JSON error messages now point to where the error is in the input.
What could break in your project
The list of incompatible changes is longer than usual. These are the ones most likely to show up in websites and business systems:
| Change | What it means |
|---|---|
trim(), ltrim() and rtrim() strip form feed (\f) by default | Rarely visible, but check code that relies on keeping that character |
fclose(), file_put_contents() and copy() return false when flushing or closing fails | Code that ignored silent failures may start seeing them, which is a good thing |
Many functions throw ValueError for out-of-range values or strings containing NUL bytes | Visible errors instead of silently truncated results |
return inside finally is deprecated | A log warning now; fix it before a later release removes it |
mbstring regex functions such as mb_ereg() and mb_split() are deprecated | Move to PCRE with the u modifier |
is_double(), is_long(), is_integer() and doubleval() are deprecated | Use is_float(), is_int() and floatval() |
spl_object_hash() is deprecated | Use spl_object_id() |
New session defaults
This one touches sign-in, so test it. In PHP 8.6, session.use_strict_mode and session.cookie_httponly are on by default, and session.cookie_samesite defaults to Lax. These are safer settings, and most modern frameworks already set them. Older systems that read the session cookie from JavaScript, or that sign users in across different domains, need a test run before the upgrade.
Custom session handlers that don't implement both create_sid() and validateId() are now deprecated. If your team wrote its own database session handler, review it.
How to plan the upgrade
- Find the PHP version your site actually runs. In cPanel it's in MultiPHP Manager; on a shell,
php -v(the command-line version can differ from the web version). - Move to the latest security patch of your current branch first. That step doesn't wait.
- Check that your framework and main libraries support 8.6.
composer outdatedand each library's release notes are the place to look. - Set up a staging copy on PHP 8.6 and log deprecation notices.
- Run your automated tests if you have them, then walk through the sensitive paths by hand: sign-in, payments, file uploads, reports.
- Switch production at a quiet time, with a clear way back to the previous version.
For most production systems we suggest waiting for the first or second 8.6 maintenance release, unless you need a specific feature now.
How long each version is supported
Under the release cycle change PHP adopted in 2024, each branch gets two years of bug fixes and then two years of security fixes only, with end dates aligned to 31 December. The supported versions page on php.net holds the exact dates. The one most projects need to act on: PHP 8.2 reaches end of life on 31 December 2026, after which it gets no security fixes at all.
If your systems run on hosting we manage, we track these dates and plan the move with you as part of our hosting and servers service. If an older system needs code changes before it can move, tell us about it and we will size the work.
FAQ
Should I move to PHP 8.6 right away?
There's no rush. PHP 8.6 is a feature release; for security, what counts is running the latest patch of your current branch. Plan the move once your libraries support it and you have tested on staging.
Does Laravel run on PHP 8.6?
That depends on your Laravel version and the other packages in your project. Check the release notes in the Laravel documentation and the composer.json constraints of your key packages before upgrading, rather than assuming.
Which PHP 8.6 change is most likely to affect a live website?
Usually the new session defaults, because they touch sign-in, and the functions that now throw ValueError instead of failing silently. Both improve safety, and both need a test run.
Will PHP 8.2 sites stop working after 31 December 2026?
No, they keep running. The difference is that any vulnerability found after that date gets no official fix, which is a real risk for sites exposed to the internet.
How do I check which PHP version my hosting runs?
In your control panel, for example MultiPHP Manager in cPanel, or with php -v if you have shell access. Remember that the shell version and the version serving your site can be different.