PHP 8.6 Released: Patch First, Upgrade Later

PHP 8.6 shipped November 19 alongside security releases for 8.2–8.5, with seven critical fixes on 8.5 alone. What's new, what changes, and what to patch first.

At 10 p.m. Taiwan time on November 19, five announcements landed on the php.net front page within a minute of each other: four security releases — 8.5.13, 8.4.28, 8.3.37 and 8.2.36 — and, a minute later, PHP 8.6.0 itself. Less than a day earlier (November 18, UTC), the PHP security team had posted a heads-up saying the highest severity in this batch was “CRITICAL”.

Most people will only notice the 8.6.0 one. 8.6 has Partial Function Application, clamp() and a new Time\Duration class, which makes for an easy “what’s new” roundup. But if you run servers with PHP on them, the four other announcements are the ones to deal with tonight.

I opened the five php.net announcements, the 8.6 release page, the migration guide in the manual, the 17 security advisories on php-src’s GitHub, and the PHP Foundation’s two most recent blog posts, and put them side by side to write this. Bottom line first: bring production up to the latest patch release on its current branch tonight, and schedule 8.6 for your next upgrade cycle.

The short version: two things to do tonight

The PHP 8.6.0 release announcement on the php.net front page, listing six features: Partial Function Application, default values for readonly properties, the Io\Poll API, the clamp() function, the \Time\Duration class and the SortDirection enum Figure 1: The PHP 8.6.0 release announcement on the php.net front page (source: php.net)

If you only have five minutes:

  1. Patch first. 8.5 goes to 8.5.13, 8.4 to 8.4.28, 8.3 to 8.3.37, 8.2 to 8.2.36. These four came out within a minute of 8.6.0 and fix the same batch of vulnerabilities.
  2. Run 8.6 in a test environment first. It changes three session defaults and deprecates a long list of things. Drop it straight into production and the thing most likely to break is login state, not new syntax.

Why not just go straight to 8.6? 8.6.0 does include all 17 fixes (the 8.6.0 section of the ChangeLog lists the same GHSA IDs), so from a security standpoint it is no worse than 8.5.13. The difference is that jumping from 8.5 to 8.6 is a major upgrade you need to test, while going from 8.5.12 to 8.5.13 is just a patch. Tonight’s job should be the lowest-risk one.

What did the same-day security releases fix?

The batch itself fell within PHP’s regular four-week release cycle; what was unusual was the severity. On November 18, php.net posted “Upcoming Critical PHP Security Release”, saying the releases would land between 14:00 and 14:30 UTC on the 19th, would affect every supported version, and carried a highest severity of CRITICAL. The notice also had one sentence that matters, which I’ll come back to: “The issues rated CRITICAL require either non-default configuration or uncommon setups.”

I pulled every GitHub Security Advisory (GHSA) listed in the four branches’ ChangeLogs, looked up the severity of each through GitHub’s public API, and cross-tabulated them into this table:

Table: which PHP branches — 8.5, 8.4, 8.3 and 8.2 — are affected by each of the seven CVSS 9.2 critical vulnerabilities; 8.5 has seven, 8.4 and 8.3 five each, 8.2 four, and counting high and medium as well the four branches fixed 17, 14, 13 and 12 vulnerabilities respectively Figure 2: Critical fixes by branch (data: php-src security advisories on GitHub and the php.net ChangeLog, checked 2026-11-20)

A few things the table makes obvious:

  • 8.5 is hit hardest. All 17 vulnerabilities apply, seven of them critical. The two extra ones (GHSA-8mjj and GHSA-2fjv) both involve fatal-error backtraces, and the advisory states that the fatal_error_backtraces setting is on by default in 8.5.
  • The critical count depends on the branch. If you see someone online say “seven criticals were fixed”, that’s the 8.5 number; 8.4 and 8.3 have five, 8.2 has four.
  • All seven criticals score 9.2 on CVSS v4.0, alongside four highs and six mediums. One of the highs deserves a closer look: with PHP-FPM’s catch_workers_output enabled, anyone who can run PHP code in an FPM worker can gain the privileges of the FPM master, which usually runs as root (GHSA-jm4m, scored 8.8).

There’s context here too: this is the second time in a month that criticals have shown up. On October 21, PHP rushed out fixes for two remote code execution bugs dubbed php2shell, which I covered in my php2shell deep dive. Two of this round’s criticals tie directly back to that one: GHSA-g3vh’s advisory says outright that it is an “incomplete fix for CVE-2026-109619”, affecting 8.3 and later; GHSA-2fjv says 8.5.12 fixed a general use-after-free, but “further scenarios” were found afterwards that let the same global get repopulated, affecting 8.5 only. If you upgraded last month and thought you were done, you need to upgrade again.

Take “requires non-default configuration” with a grain of salt

Back to that line in the php.net notice: “The issues rated CRITICAL require either non-default configuration or uncommon setups.” I read the impact and mitigation sections of all seven critical advisories. The statement broadly holds, but two advisories phrase things more subtly:

  • GHSA-fm2m (session file writes interrupted midway): the advisory says the affected session storage is files, “which is PHP’s default”. To exploit it, an attacker also has to be able to influence session contents, interrupt the write partway through, and the application needs a usable deserialization gadget chain.
  • GHSA-8mjj (magic-method backtraces): the advisory says fatal_error_backtraces is “enabled by default” in 8.5, and PHP’s built-in defaults include arguments in backtraces; what actually blocks the attack path is zend.exception_ignore_args=1 in php.ini-production. The advisory also names Laravel facades and Magento’s guest shipping estimate as code that really does reach magic methods, while stating plainly that “exploitation of a complete Laravel or Magento installation has not been demonstrated”.

None of this contradicts “non-default configuration”. The preconditions really are numerous; some of them just happen to be defaults. My reading: don’t use that sentence to talk yourself into upgrading later. GHSA-8mjj in particular relies on php.ini-production for protection. The documentation for the official Docker PHP image is clear on this: the image ships both php.ini-development and php.ini-production templates and “strongly recommends” the production one for production use, with an example that renames it to php.ini yourself using mv. Does your Dockerfile have that line? Checking the effective settings with php --ini and php -i beats guessing.

Here are the other criticals’ preconditions, one line each:

  • GHSA-qc49 (PHP-FPM request smuggling): the front end has to reuse backend connections — nginx’s fastcgi_keep_conn on, say, or Apache mod_proxy_fcgi with enablereuse=on — and the application has a path that opens php://input without reading it to the end. The advisory says standard nginx and Apache setups that close the FastCGI connection after every request are not affected by this attack.
  • GHSA-gr4f (timezone cache): PHP has to emit a diagnostic at startup (a configuration error or deprecation warning, for example), the error log has to be written to a file, and a new worker then hits an early diagnostic while handling its first request. The interim mitigation is to fix the startup warnings, or log through something like syslog that doesn’t use file timestamps.
  • GHSA-658j (session upload progress): session upload progress has to be enabled, and the serialization format used to write and read the session has to differ. php.net posted an informational notice on October 23 recommending session.upload_progress.enabled be set to 0.
  • GHSA-g3vh: a fatal error occurs in a callback at session close. The advisory mentions that PHP-FPM can temporarily block the demonstrated attack sequence with pm.max_requests=1, at a cost in performance.

All of these are only for the window when you can’t upgrade yet. The first mitigation listed in every single advisory is to upgrade.

The patch releases hide a default change

You won’t spot this in the ChangeLog; you have to read the mitigation section of GHSA-658j: this round of fixes turns session upload progress off by default, and when the feature is enabled, it refuses runtime changes to session.serialize_handler.

In other words, even if you never touch 8.6 and only go from 8.4.27 to 8.4.28, the default for session.upload_progress.enabled changes from 1 to 0. If your site uses that feature for large-upload progress bars and relies on the default to keep it on, the bar will sit at 0% after the upgrade. To keep using it, set it to 1 explicitly in php.ini; the advisory also warns that if you enable it explicitly, every program reading and writing the same session store must use the same session.serialize_handler.

While I was at it, I checked the session configuration table in the PHP manual. When I looked, it still listed the default for session.upload_progress.enabled as “1”, and session.use_strict_mode as “0”. The manual apparently hasn’t caught up yet; go by how the actual release behaves.

So what’s actually new in PHP 8.6?

With security out of the way, on to 8.6 itself. The release page highlights six features:

The Key Features section of the PHP 8.6 release page, with six cards: Partial Function Application, New \Time\Duration Class, Polling API, New clamp() Function, New SortDirection Enum and Readonly Property Defaults Figure 3: The six headline features on the PHP 8.6 release page (source: php.net)

Partial Function Application is the biggest syntax change. You fill in some arguments up front and use ? or ... as placeholders for the rest, which gives you a Closure that only makes the real call once the remaining arguments arrive. The release page’s example:

$supportsPfa = array_filter(
    $versions,
    version_compare(?, '8.6', '>='),
);

Previously you’d have written fn ($version) => version_compare($version, '8.6', '>='). The release page also notes that array_map() with a first-class callable or partially applied callback now compiles down to a loop, as part of the performance improvements.

clamp() keeps a value within a range, replacing the max(0, min($x, 100)) pattern that always takes a second to parse:

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

It isn’t limited to numbers — anything comparable works, including the new Duration.

Time\Duration represents elapsed time independent of time zones; the release page says it can represent a span of more than 250 years at nanosecond precision. The PHP Foundation’s November 3 post explains why it’s needed: in PHP’s own standard library, “a span of time” is expressed in seconds (sleep()), milliseconds (CURLOPT_TIMEOUT_MS), microseconds (usleep()) and nanoseconds (hrtime()), each its own way. Duration is meant as the first brick in unifying that; the follow-up Time\Instant and Time\Clock are still under RFC discussion.

The SortDirection enum has just two values, Ascending and Descending. The same post says a GitHub search for SortDirection turned up more than 150 mutually incompatible homemade versions. With it built in, libraries can use it directly in public APIs instead of each defining their own.

The Io\Poll API is a low-level interface for event-loop libraries like ReactPHP and AMPHP; it picks epoll, kqueue, event ports or WSAPoll depending on the platform. The release page’s comparison example specifically notes that the old stream_select() is based on select(), “which typically can’t handle more than 1024 connections”. Most people building websites won’t touch it directly, but anyone writing long-lived connection services in PHP will feel the difference.

Readonly properties can have default values, so you no longer need a constructor just to implement a read-only interface property:

final readonly class SlugRule implements Rule
{
    public string $parser = SlugParser::class;
}

Beyond those six, a few others are worth mentioning: stream operations can be configured to throw StreamException, instead of you having to fish out error messages with @ plus error_get_last(); function parameters can have their own DocComments; the Sodium extension adds post-quantum key encapsulation (X-Wing and ML-KEM-768); mysqli gets quote_string(); and JSON error messages now point to where in the input the error is.

Before upgrading to 8.6, check these three session defaults

What actually breaks sites after an upgrade usually isn’t the new features — it’s the defaults. 8.6 changes three session settings to safer values:

Table: four session settings that change under you. session.use_strict_mode goes from 0 to 1, session.cookie_httponly from 0 to 1, and session.cookie_samesite from unset to Lax, all as of 8.6.0; session.upload_progress.enabled goes from 1 to 0 as of the 8.2.36, 8.3.37, 8.4.28 and 8.5.13 fix Figure 4: Session defaults that change on upgrade (data: PHP manual 8.6 migration guide, session configuration table, GHSA-658j-r8rw-q6mx)

Here’s what each one does:

  • session.use_strict_mode becomes 1. Session IDs the server didn’t issue are rejected, which blocks session fixation. If you wrote your own session handler, note this: the migration guide says that if your handler relied on accepting externally supplied IDs not yet in storage, you must implement validateId() and create_sid(), or explicitly set this back to 0.
  • session.cookie_httponly becomes 1. JavaScript can no longer read the session cookie. A well-behaved site shouldn’t let the front end read it anyway, but if yours actually does, it will break.
  • session.cookie_samesite becomes Lax. In the migration guide’s words, session cookies are no longer sent with “cross-site requests”, except top-level navigations using safe HTTP methods. Applications that need the session on cross-site POSTs must explicitly set it to None and also set session.cookie_secure to 1.

The third one is what I most want to flag. This is my own inference, not something the migration guide says: many e-commerce sites in Taiwan integrate payment gateways where, after payment, the gateway’s page sends the user back to the store with a form POST — which is exactly a cross-site POST. If your payment-result page relies on the session to know who the user is, make sure you put a real test payment through in a test environment after upgrading to 8.6.

Also, custom session handlers that don’t implement both create_sid() and validateId() will get a deprecation warning in 8.6.

Other deprecations and breaking changes you might hit

The release page and migration guide have a long list. I picked the ones that are more common and more likely to show up in existing projects:

  • return inside a finally block is deprecated, because it silently swallows exceptions and overrides the return value of try or catch.
  • mb_ereg(), mb_split() and the other mbstring regex functions are deprecated, because the underlying Oniguruma library stopped being maintained in April 2025; removal is planned for PHP 9.0. The official recommendation is to switch to PCRE functions with the u modifier.
  • The aliases is_double(), is_long(), is_integer() and doubleval() are deprecated; use is_float(), is_int() and floatval() instead.
  • spl_object_hash() is deprecated; use spl_object_id() instead.
  • strcoll() and SORT_LOCALE_STRING are deprecated; use the intl extension’s Collator instead.
  • The trim() family now strips the form-feed character (\f) by default, and fclose(), file_put_contents() and copy() return false on write failure instead of silently ignoring it.
  • Many functions now throw ValueError on out-of-range values, invalid flags or strings containing NUL bytes, where they used to silently truncate or ignore them.

Deprecations only produce warnings; they don’t stop your program. But if your error handling turns warnings into exceptions (many frameworks do this in development), a test run will light up all at once. My suggestion: run your test suite on 8.6 in CI first, pull out the list of warnings, then decide on an upgrade timeline.

Still on 8.2? You have under six weeks

This is the easiest thing to miss tonight. I opened php.net’s supported versions page, and 8.2’s security support ends on December 31, 2026:

The table on php.net's supported versions page: PHP 8.2 was first released on December 8, 2022, active support ran until December 31, 2024, and security support runs until December 31, 2026; 8.3 has security support until the end of 2027, 8.4 until the end of 2028 and 8.5 until the end of 2029 Figure 5: php.net’s table of supported PHP versions (source: php.net)

8.2.36 is very likely one of the last few patch releases 8.2 will get. After December 31, new vulnerabilities in 8.2 won’t get official fixes — and the past two months suggest criticals aren’t rare. If a project is still on 8.2, upgrade to 8.2.36 tonight, then put “move to 8.3 or later” on next month’s list. 8.3 has security support until the end of 2027, 8.4 until the end of 2028, and 8.5 until the end of 2029.

Incidentally, when I checked, the table didn’t have a row for 8.6 yet. Going by the policy stated on that page (two years of active support per release, then two more years of critical security fixes only), 8.6 should be supported until around the end of 2030 — but that’s my calculation from the policy, not an officially announced date.

Has the ecosystem caught up?

Your own code running fine doesn’t mean your framework and platform are ready. I checked the two most common environments:

  • The official Docker image is already there. I queried the tags of the php image through Docker Hub’s API: 8.6.0, 8.6.0-fpm, 8.6.0-apache, 8.6.0-cli, plus Debian trixie, bookworm and Alpine variants, are all available. When I checked, these tags showed a last-updated time of around 16:00 UTC on November 19, roughly two hours after the official release; that field changes whenever a tag is re-pushed, so what’s certain is that they were there on release day.
  • WordPress’s compatibility table doesn’t list 8.6 yet. The official WordPress handbook page “PHP Compatibility and WordPress Versions” was updated on November 4; the newest column in its table (the leftmost one) is 8.5, and WordPress 7.1 supports up to 8.5. That only means the table hasn’t added 8.6, not that WordPress has declared it incompatible — but for a WordPress site, I’d wait for the table to add 8.6 before making a move.

As for frameworks, I didn’t check Laravel’s or Symfony’s 8.6 support one by one; go by each project’s release notes on that.

My recommendation: three batches

Boiling all of this down into a to-do list:

Tonight (or first thing tomorrow at work): bring every production environment up to the latest patch release on its branch. Internet-facing machines first, and PHP-FPM behind a front end with backend connection reuse enabled before anything else. After upgrading, check whether the session.upload_progress.enabled change affects your upload progress bars.

This month: if you’re on 8.2, set a schedule for moving to 8.3 or later. While you’re at it, check that production uses php.ini-production rather than the built-in defaults.

Next upgrade cycle: add 8.6 to CI, deal with the deprecation warnings, test cross-site flows like login and payment returns, and then decide when to switch to 8.6.

8.6’s new features are solid. Partial Function Application and clamp() are the kind of thing you can’t go back from once you’ve used them, and Duration and SortDirection lay the groundwork for the whole ecosystem to share a common vocabulary. But new features aren’t going anywhere, and vulnerabilities get exploited. Get the order right first, then enjoy 8.6 properly.

Sources: php.net front-page announcements (2026-11-18, 2026-11-19, 2026-10-23), the PHP 8.6 release page, the PHP 8.6 migration guide, the ChangeLog, the supported versions page, php-src security advisories on GitHub, the PHP Foundation’s “Designed Once, Usable Everywhere” and “Today’s PHP Security Release”, the official Docker PHP image documentation, and the WordPress PHP compatibility table. All accessed November 19–20, 2026.

About the author

I’m Ryan, and I run RyanOps. My day job is software development and automation; here I track what changes in AI models, developer tools and software engineering, and write up hands-on notes from problems I have debugged and built myself.