# PHP 8.6 for Laravel and Filament apps: what to check before you switch

> PHP 8.6 came out on 19 November 2026. What changes for a Laravel or Filament app, which packages test on it, and how to try it in CI before you switch.

PHP 8.6.0 came out on 19 November 2026. If you run a Laravel 13 app with a Filament 5 panel, you probably want to know whether you can switch this week, what will show up in your logs when you do, and whether your packages are ready.

Here's the short version, as of release day. Composer will let you install on 8.6 today, and Laravel has merged most of its 8.6 fixes, with one pull request still open. Most of the stack doesn't run 8.6 in CI yet, though, so add an 8.6 job to your own CI now and turn on the deprecations log. Move production once your key packages test on 8.6 and your host offers it.

This guide draws on PHP's own [upgrade notes](https://github.com/php/php-src/blob/PHP-8.6/UPGRADING), the feature pages on [php.watch](https://php.watch/versions/8.6) and Paul Redmond's [overview on Laravel News](https://laravel-news.com/php-8-6), a clear tour of the whole release. The package checks below were made on 19 November 2026, release day, and the tables carry that date.

## What PHP 8.6 adds that a Laravel app can use

Four additions fit everyday Laravel code. The first two, `clamp()` and `SortDirection`, already work on PHP 8.3: Laravel 13.7 and later require `symfony/polyfill-php86`, which ships both (plus `grapheme_strrev()`).

**`clamp()`** keeps a value between two bounds, which replaces the `min(max(...))` pair that's easy to get backwards. It throws a `ValueError` when `$min` is greater than `$max`:

```php
$perPage = clamp($request->integer('per_page', 25), 10, 100);
```

**`SortDirection`** is an enum with two cases, `Ascending` and `Descending`. Laravel's query builder accepts it since 13.8 and collections since 13.7:

```php
use SortDirection;

Order::query()->orderBy('created_at', SortDirection::Descending)->get();
```

**Partial function application** gives you a closure with some arguments fixed: `?` stands for one argument and `...` for the rest. This one is new syntax, so it needs PHP 8.6 everywhere the code runs, CI included:

```php
$slugs = array_map(Str::slug(?, separator: '_'), $titles);
```

PHP 8.6 also compiles `array_map()` with a first-class callable or a partial into the equivalent `foreach` loop, which skips the intermediate closure.

**Readonly properties with defaults** make small value objects shorter: `public readonly int $retries = 3;` is now allowed.

The upgrade notes list more: `#[\Override]` on class constants and enum cases, `__debugInfo()` on enums, line and column positions in `json_decode()` error messages, a `Time\Duration` class, and faster `json_encode()`, `printf()` and stateless closures. php.watch has a page for most of them.

## PHP 8.6 deprecations you'll see in logs and tests

A deprecation is a notice, not an error. Your app keeps running, and the deprecated feature is slated for removal in a later major version. Laravel discards deprecations unless you give them a channel, so turn that on in staging and in your local `.env` first:

```ini
LOG_DEPRECATIONS_CHANNEL=single
LOG_DEPRECATIONS_TRACE=true
```

In tests, `php artisan test --display-deprecations` lists each test that triggered one. Artisan passes the option through to Pest or PHPUnit.

These are the 8.6 deprecations a Laravel app is most likely to meet:

| Deprecated in 8.6 | Use instead | Where it tends to come from |
| --- | --- | --- |
| `spl_object_hash()` | `spl_object_id()` | Packages that key caches or maps by object |
| `is_double()`, `is_integer()`, `is_long()`, `doubleval()` | `is_float()`, `is_int()`, `floatval()` | Older helpers and validation code |
| A `SessionHandlerInterface` class without `create_sid()` and `validateId()` | Add both methods | Custom session drivers registered with `Session::extend()` |
| `mb_ereg*()` and `mb_split()` | `preg_*()` with the `u` modifier | String helpers. Laravel's `Str` switched in 13.9. |
| `SORT_LOCALE_STRING` and `strcoll()` | `Collator::sort()`, `Collator::compare()` | Locale-aware sorting |
| `is` or `let` as a class or function name, `_` as a constant name | Rename | `guzzlehttp/promises` has an `Is` class. Version 3.1.0 adds `State` to replace it. |
| `return` inside `finally`, a value returned from `__construct()` | Move the return out, drop the value | Your own code, rarely |
| `ArrayIterator` sort methods, `SplFileObject` CSV methods | Sort the array before wrapping it, a CSV library | CSV imports and exports |

The full list is in [section 4 of the upgrade notes](https://github.com/php/php-src/blob/PHP-8.6/UPGRADING).

### Custom session handlers need two new methods

Laravel's own session handlers gained `create_sid()` and `validateId()` in 13.31 and 13.32, so the built-in drivers are covered. If your app registers its own driver, add the same pair. This is how Laravel's file handler does it:

```php
public function create_sid(): string
{
    return session_create_id() ?: throw new RuntimeException('Unable to create a session ID.');
}

public function validateId($id): bool
{
    return $this->files->isFile($this->path.'/'.$id);
}
```

For a database or API-backed driver, `validateId()` checks whether a session with that ID exists in your store.

### Changes that aren't deprecations

A few behaviors change outright. Most of them don't touch a typical Laravel app, but they're worth knowing when a test fails:

- **`trim()` strips form feeds (`\f`) by default.** Laravel's `TrimStrings` middleware uses `Str::trim()`, which already matched `\f` through `\s`, so trimmed request input stays the same.
- **Native session defaults are stricter:** `session.use_strict_mode=1`, `session.cookie_httponly=1`, `session.cookie_samesite=Lax`. Laravel runs its own session layer, and its cookie settings stay in `config/session.php` (`http_only` true and `same_site` lax by default). In the app we checked, Laravel, Filament and Livewire contain no `session_start()` call.
- **`array_filter()` throws a `ValueError`** for an unknown `$mode`. Many other functions now throw on NUL bytes or out-of-range arguments where they used to warn.
- **`fclose()`, `file_put_contents()` and `copy()` return `false`** when the final flush fails. Before 8.6 those failures went unreported.
- **A hard out-of-memory now exits with code 134** instead of 1, and may write a core dump. If your process monitor or alerts look for exit code 1, add 134, because that's what a queue worker that runs out of memory returns now.

### A quick scan of `vendor/` before the test run

A grep gives you a first list of places to look. We ran this one on our own store app (Laravel 13.33, Filament 5.9, Livewire 4.4.6):

```bash
grep -rlE '\b(spl_object_hash|is_double|is_integer|is_long|doubleval|strcoll|metaphone|mb_split)\(|SORT_LOCALE_STRING|mb_ereg' \
  vendor --include='*.php' | grep -v -e '/tests/' -e 'symfony/polyfill' | cut -d/ -f2,3 | sort -u
```

It listed ten packages. Five of them were for `spl_object_hash()`, among them `laravel/serializable-closure`, which already checks `PHP_VERSION_ID` and calls `spl_object_id()` on 8.6. A hit is a place to look, not a problem. `laravel/framework` shows up for its docblocks and the one sorting path covered in the next section. The test run on 8.6 is what tells you which calls actually fire.

## Which packages test on PHP 8.6, as of 19 November

Composer ranges such as `^8.3` already include 8.6, so `composer install` won't stop you. What a maintainer's CI matrix runs tells you more, because that's what they test against:

| Package | Latest release (date) | PHP constraint | CI matrix on 19 Nov |
| --- | --- | --- | --- |
| `laravel/framework` | 13.43.0 (17 Nov) | `^8.3` | 8.3, 8.4, 8.5. Pull request [#61771](https://github.com/laravel/framework/pull/61771) adds 8.6 and is open. |
| `filament/filament` | 5.11.4 (15 Nov) | `^8.2` | 8.3, 8.4, 8.5 |
| `livewire/livewire` | 4.4.8 (21 Oct) | `^8.1` | 8.1 to 8.5 |
| `laravel/octane` | 2.25.0 (17 Nov) | `^8.2.0` | 8.2 to 8.5 |
| `laravel/horizon` | 5.52.0 (16 Nov) | `^8.2` | 8.2 to 8.5 |
| `pestphp/pest` | 5.3.7 (16 Nov) | `^8.4` | 8.4, 8.5, **8.6** |
| `spatie/laravel-permission` | 8.5.0 (6 Nov) | `^8.3` | 8.3 to 8.5, plus an **8.6** job with Laravel 13 |
| FrankenPHP | | | An experimental 8.6 job since September ([#2658](https://github.com/php/frankenphp/pull/2658)) |

Laravel has done much of the work already. The session handler fixes, the `mb_split()` replacement and `SortDirection` support are all in 13.x releases. The open pull request swaps the remaining `SORT_LOCALE_STRING` and `strcoll()` use in collection sorting and tracks deprecations in a few third-party packages. Matrices change often around a release, so check the ones you depend on again on the day you switch.

## Try PHP 8.6 in CI first, then locally

### Add an 8.6 job that's allowed to fail

The cheapest first step is one more CI job that runs your suite on 8.6 and reports without blocking the merge. In GitHub Actions with [setup-php](https://github.com/shivammathur/setup-php), it looks like this:

```yaml
strategy:
  fail-fast: false
  matrix:
    php: ["8.4", "8.5"]
    experimental: [false]
    include:
      - php: "8.6"
        experimental: true

continue-on-error: ${{ matrix.experimental }}

steps:
  - uses: shivammathur/setup-php@v2
    with:
      php-version: ${{ matrix.php }}
      extensions: intl, pdo_sqlite
      coverage: none

  - run: composer update --no-interaction --prefer-dist ${{ matrix.experimental && '--ignore-platform-req=php+' || '' }}

  - run: php artisan test --display-deprecations
```

`--ignore-platform-req=php+` ignores only the upper bound of PHP constraints. A dependency that caps its range below 8.6 then installs anyway, which is what you want in an experimental job. Spatie's laravel-permission matrix uses the same flag for its 8.6 job.

On release day, setup-php's README still lists `8.6` as a nightly build from the PHP-8.6 branch. Check the README again to see when `8.6` points at the stable release.

### Run it locally

On your machine, Docker works today and the other two follow:

- **Docker:** the official image's source moved to 8.6.0 on release day, and the plain tags (`8.6-cli`, `8.6-fpm`, `8.6-fpm-alpine` and more) appear on Docker Hub as the builds finish. If `php:8.6-cli` isn't there yet when you pull, `php:8.6-rc-cli` gives you the last release candidate. The official image leaves out `intl`, which Filament needs, and `zip`, which Composer uses to unpack packages (`pdo_sqlite` is included), so add both:

  ```dockerfile
  FROM php:8.6-cli
  RUN apt-get update && apt-get install -y libicu-dev libzip-dev unzip \
      && docker-php-ext-install intl zip
  COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
  ```

- **Laravel Sail:** its `runtimes` folder goes up to 8.5 on 19 November. Watch the repository for an 8.6 runtime.
- **Laravel Herd** or your package manager: use whichever version it offers once 8.6 is listed.

## Every place the runtime lives

When you switch, PHP 8.6 has to reach every copy of PHP your app runs:

- the CLI and PHP-FPM, which are separate binaries;
- queue workers, Horizon and Reverb, which keep the old PHP until they restart;
- Octane and FrankenPHP, since FrankenPHP embeds its own PHP;
- Docker `FROM` lines, CI and your host's images.

Our [security release checklist](https://packstub.dev/guides/laravel-php-nodejs-security-release-checklist) walks through each of those places with the commands to check it, and the same walk works for a version change.

On managed hosting, the version list is the host's. On 19 November, Laravel Cloud's runtime docs list PHP 8.2 to 8.5 with 8.5 as the default, and the Forge changelog has no 8.6 entry yet. Check both pages when you're ready to switch.

## When to switch, and when to wait for 8.6.1

You don't have to hurry. PHP 8.5 has active support until 31 December 2027 and security fixes until 31 December 2029, and 8.4 has security fixes until the end of 2028. An app on 8.4 or 8.5 can pick its moment.

**Switch early** when your dependency tree is small, your tests cover the panel and the queue, and the 8.6 CI job is green with a short deprecation list. A new project is a good candidate.

**Wait for the first patch release** when the app is busy or the dependency list is long. The first patch fixes what the wider world finds in the first weeks: PHP 8.5.1 came on 18 December 2025, four weeks after 8.5.0. That also gives the test matrices above, and your host's version list, time to catch up.

**If you're on PHP 8.2,** plan that move first. Its security support ends on 31 December 2026, and Laravel 13 already needs 8.3. Moving to 8.4 or 8.5 now and to 8.6 later is a calm path.

## A worked example: the Packstub plugins

Our own plugins are typical of a Filament package's setup. Their PHP constraints are `^8.2`, `^8.3` (Filament Teams, Flow, Kanban and most others) or `^8.4` (Filament Tenancy, Filament Agents), and the installation pages say the same, for example [Filament Flow's](https://packstub.dev/docs/filament-flow/installation) and [Filament Tenancy's](https://packstub.dev/docs/filament-tenancy). Composer will install all of them on 8.6.

None of their test matrices includes 8.6 on 19 November, which matches Filament's own. Until a package you use adds 8.6 to its matrix, the 8.6 job in your app's CI is the test that covers it, which is one more reason to add that job first.

## Where to start

Today, add the 8.6 job to your CI and set `LOG_DEPRECATIONS_CHANNEL` on staging. When the job is green and the packages you rely on test on 8.6, take the [list of places PHP runs](https://packstub.dev/guides/laravel-php-nodejs-security-release-checklist#every-place-php-runs) and move them one by one, staging first.
