AuthonAuthon Blog
news9 min read

PHP 8.6: New Features, Breaking Changes, and Why Laravel Isn't Faster

Laravel 13 did 792.70 req/s on PHP 8.5 and 792.33 on 8.6. What 8.6 is good for, and the session cookie defaults that change on day one.

AW
Alan West
Authon Team
PHP 8.6: New Features, Breaking Changes, and Why Laravel Isn't Faster

PHP 8.6.0 shipped on November 19, 2026. If you're hoping it makes your Laravel app faster, it won't. In Tideways' benchmark, Laravel 13 did 792.70 requests per second on PHP 8.5 and 792.33 on PHP 8.6.

I'm upgrading anyway. The new stuff in 8.6 is language and stdlib work: partial function application, clamp(), a real Duration type, an epoll/kqueue polling API. Some of it is the best PHP has shipped in years. The cost is a long deprecation list and a handful of quiet breaking changes, including new session cookie defaults, that the feature tours skip. I went through the official release page and UPGRADING for both halves, and checked whether Laravel, Symfony and WordPress support PHP 8.6 yet.

The 6 new PHP 8.6 features I'd upgrade for

Partial function application (PFA)

Use ? for one missing argument and ... for the rest, and you get a Closure back. This is the feature I'll use every day:

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

On Hacker News, one commenter pointed out that the |> pipe operator from 8.5 "without PFA frequently ends up with longer code and isn't pretty", which is a good reason to jump straight to 8.6. Another worried that it "makes a function declaration look reaaaaally close to a function invocation." Fair. foo(?, 1) and foo($x, 1) look almost the same in a code review, and I fully expect my team to ship at least one bug from misreading one as the other.

\Time\Duration

A time span with nanosecond precision that can cover more than 250 years, independent of any point in time or timezone. Durations are comparable, so min($delay, Duration::fromSeconds(30)) works. If your codebase has microsecond integers like usleep(min($delay, 30_000_000)), you can now remove them.

Io\Poll, a real polling API

Io\Poll\Context uses epoll, kqueue, event ports or WSAPoll, so you're no longer stuck with stream_select() and its usual 1024-connection limit. Most app developers will never touch it directly; it's for ReactPHP and AMPHP.

clamp()

clamp(110, 0, 100) returns 100, replacing max(0, min(110, 100)). It also works with any comparable value, Duration included.

The SortDirection enum

SortDirection::Ascending and SortDirection::Descending replace SORT_ASC in signatures. A method that took int $direction would happily accept SORT_STRING and then fail inside the method. With the enum, passing the wrong value throws a TypeError at the call.

Readonly property defaults

Instance readonly properties can now declare a default, so public string $parser = SlugParser::class; works in a readonly class. The default counts as initialization, so the constructor can't overwrite it.

Also new: stream errors as exceptions

The release page also lists stream error handling, which I'd rank above half of the six. With 'error_mode' => StreamErrorMode::Exception in a stream context, file_get_contents() throws a StreamException. That exception carries structured StreamError objects, so you can drop the @ plus error_get_last() routine. Smaller additions: #[\Override] works on constants and enum cases, ReflectionParameter::getDocComment() exists, you can write Config::DEFAULTS->timeout = 30 on objects stored in constants, there's mysqli::quote_string(), and JSON error messages now tell you where in the input the error is.

Is PHP 8.6 faster? Microbenchmarks yes, frameworks no

UPGRADING lists real engine work, but it has no numbers. Benjamin Eberlei's Tideways write-up has them:

| Change | Before | After |
|---|---|---|
| printf with only %s/%d | 1484.5 | 540.3 (−63.6%) |
| Stateless static fn closure cache | 880.9 | 487.2 (−44.7%) |
| First-class callables | 1637.5 | 833.2 (−49.1%) |
| array_map(foo(...)) | 422.6 ms | 412.0 ms (−2.5%, error bars overlap) |

Times are in ms, and the printf and closure gains only apply inside functions. He also says "About half of the ZTS overhead compared to the "classic" NTS mode (PHP-FPM uses that) was removed." On HN he said that was the change he was most excited about.

Now the full-app numbers from the framework benchmark (8.6.0 RC 5, JIT off, 15 concurrent users):

| App | PHP 8.4 RPS | PHP 8.5 RPS | PHP 8.6 RPS |
|---|---|---|---|
| Laravel 13.17.0 | 778.50 | 792.70 | 792.33 |
| Symfony 8.1.9 | 460.20 | 458.14 | 469.36 |
| WordPress 7.1.3 | 160.30 | 158.23 | 159.60 |

The author's own summary is "no major engine improvements that makes it broadly faster than previous versions." Symfony gets "roughly 2.5%" more throughput over 8.5. Anyone selling 8.6 as a speed upgrade hasn't read the benchmark. Cutting 63.6% off printf time doesn't help much when your request spends its time waiting on MySQL.

PHP 8.6 deprecations that will hit real codebases

The deprecations RFC is long, and a few more (mbregex, for one) came through separate RFCs. These are the ones I'd grep for first:

  • spl_object_hash() is deprecated in favour of spl_object_id(). Lots of older packages still use it.
  • is_integer(), is_long(), is_double() and doubleval() are deprecated aliases. Rector renames them for you.
  • strcoll() and SORT_LOCALE_STRING are deprecated; use Collator from intl.
  • All of mbregex (mb_ereg(), mb_split() and the rest) is deprecated because Oniguruma is unmaintained. Switch to preg_* with the u modifier.
  • return inside finally is deprecated, and so is returning a value from __construct() or __destruct().
  • let and is are deprecated as class, function or constant names. guzzlehttp/promises has a class named Is; 3.1.0 deprecates it and adds State as the replacement.
  • Passing an object to array_walk() or http_build_query() is deprecated.
  • metaphone() and the CSV methods on SplFileObject are deprecated. So are the sort, flag and serialization methods on ArrayIterator.
  • Custom session handlers that don't implement both create_sid() and validateId() are deprecated.

Run this to see how much work you have:

bash
grep -rnE "spl_object_hash|is_(integer|long|double)\(|doubleval\(|strcoll\(|SORT_LOCALE_STRING|mb_ereg|mb_split|metaphone\(" src/ app/

PHP 8.6 breaking changes that don't look like breaks

Deprecations only produce warnings. The changes below alter behaviour the day you switch:

  • Session defaults changed. session.use_strict_mode and session.cookie_httponly are now 1, and session.cookie_samesite is Lax. Good for security, but if something in your app reads the session cookie from JavaScript, or relies on a cross-site POST arriving with the session attached, test it before you deploy.
  • trim(), ltrim() and rtrim() now strip form feed (\f) by default. Laravel's 8.6 PR includes a "trim related" fix for its Validation component, so check anything that compares trimmed input.
  • fclose(), file_put_contents() and copy() now return false when the flush or close fails. Before, the failure was ignored.
  • Filesystem functions such as file_exists(), is_file() and stat() now throw ValueError when the filename contains a NUL byte, and so do getenv() and putenv(). number_format() throws when $decimals is outside the integer range instead of silently clamping it.
  • DOM properties that were documented as @readonly, such as DOMNode::$nodeType, are now public private(set). Writing to them throws an error.
  • preg_grep() returns false on a PCRE execution error. It used to return a partial array.

Do Laravel, Symfony and WordPress support PHP 8.6?

As of November 20, 2026:

| Project | PHP 8.6 status |
|---|---|
| Laravel | Not official. The 13.x docs list 8.3 to 8.5. The support PR #61771 went ready for review on Nov 20. The external deprecations it tracks in guzzlehttp/promises, opis/json-schema and ably/ably-php are all ticked off or struck through, but it isn't merged. |
| Symfony | 8.1.5 (August) already shipped "Fix PHP 8.6 deprecations". symfony/polyfill-php86 backports clamp, SortDirection and grapheme_strrev. |
| WordPress | The compatibility table stops at 8.5. |
| PHPStan | 2.3.6 claims "Full support for PHP 8.6, including Partial Function Application". |
| Rector | Has a php86 set via withPhpSets(php86: true). LevelSetList::UP_TO_PHP_86 exists too, but the class is deprecated. |

Laravel's composer.json says "php": "^8.3" and already requires symfony/polyfill-php86, so Composer won't stop you from installing on 8.6. The deprecation notices from vendor packages will show up anyway.

PHP 8.6 upgrade checklist

  • Run your test suite on the official image. php:8.6-cli, 8.6-fpm, 8.6-apache and 8.6-alpine are on Docker Hub. There's no 8.6-zts tag yet, only 8.6-rc-zts.
  • bash
       docker run --rm -v "$PWD":/app -w /app php:8.6-cli php vendor/bin/phpunit
  • Find dependencies that pin older PHP: composer why-not php 8.6.0.
  • Let Rector do the mechanical work. Its php86 set rewrites min/max pairs into clamp(), moves constructor assignments into readonly defaults and renames the deprecated aliases (is_integer to is_int, doubleval to floatval and so on).
  • php
       return RectorConfig::configure()
           ->withPaths([__DIR__ . '/src'])
           ->withPhpSets(php86: true);
  • Point PHPStan at 8.6 with phpVersion: 80600. Use 2.3.x; 2.1.x caps the setting at 80599 and rejects it.
  • Turn on E_DEPRECATED in CI and fix your own code first. Vendor notices can wait for upstream.
  • Diff your session INI against the new defaults before you deploy.
  • You have time. Active support runs until 31 Dec 2028 and security fixes until 31 Dec 2030 (supported versions). 8.4 gets active support only until 31 Dec 2026, so that's the branch to move off first.
  • My plan: upgrade CI this week, production after the Laravel PR merges, and start writing PFA in new code once it's live. Before your first 8.6 deploy, patch the version you're on now. 8.5.13, 8.4.28, 8.3.37 and 8.2.36 went out the same day as security releases, and php.net rated the worst issue critical.

    Which PHP 8.6 feature are you actually going to use, and which deprecation is going to cause the most pain in your codebase? If you think PFA's ? syntax is a readability disaster, say so in the comments.

    Sources

    PHP 8.6: New Features, Breaking Changes, and Why Laravel Isn't Faster | Authon Blog