PHP 8.6 is close enough that I would be adding it to a test environment now. There are useful language improvements, better diagnostics and some changes that can expose assumptions in older code. For a Laravel or NativePHP application, finding those assumptions before the runtime upgrade is the useful part.
This preview is based on PHP 8.6.0RC5, released on 5 November 2026. It is a prerelease. The official timetable targets general availability for 19 November, subject to development progress. The examples below are things to try in an isolated 8.6 environment while your production app stays on its supported release.
An invalid JSON document is much easier to investigate when the error tells you where to look. PHP 8.6 adds location information to messages returned by json_last_error_msg() and to JsonException messages. Your existing exception-based decoding can benefit without a new decoding API:
try {
json_decode(
'{"title": "A Wizard of Earthsea", "rating": }',
associative: true,
flags: JSON_THROW_ON_ERROR,
);
} catch (JsonException $exception) {
report($exception);
}That example intentionally contains a missing value. In a Laravel import action, the extra location information can help you distinguish a malformed export from a problem in the mapping code. Keep a friendly validation message in the interface and the diagnostic detail in your reporting path. Do not attach the entire uploaded document just to investigate one broken field.
If your tests assert the exact old exception message, review them. Prefer checking the exception type and the behavior your application promises unless the message itself is part of your contract. Better diagnostics should not create a pile of irrelevant test failures.
Enums gain support for __debugInfo(). That gives an enum a way to present useful derived information during debugging, alongside its name and backing value. For an app with several states, a small amount of context can save jumping between the dump and the enum definition:
enum ExportState: string
{
case Queued = 'queued';
case Finished = 'finished';
/** @return array{name: string, value: string, terminal: bool} */
public function __debugInfo(): array
{
return [
'name' => $this->name,
'value' => $this->value,
'terminal' => $this === self::Finished,
];
}
}
var_dump(ExportState::Finished);This is a debugging view. Keep API serialization and persistence explicit rather than making them depend on what a dump displays. I would use it for small, cheap pieces of state, not database lookups or anything that changes the application while I am inspecting it.
The #[Override] attribute can now be applied to class constants, including enum cases. It makes the relationship to a parent or interface visible and lets PHP catch an intended override that no longer matches. A simple exporter hierarchy shows the idea:
abstract class Exporter
{
public const string FORMAT = 'generic';
}
final class JsonExporter extends Exporter
{
#[\Override]
public const string FORMAT = 'json';
}If you rename the parent's constant and forget this implementation, the attribute gives PHP something to enforce. This is particularly useful in extension points where multiple implementations follow the same contract. Use it where an override is intentional; a genuinely new constant should remain a new declaration.
The RC5 upgrade notes also list readonly property defaults, partial function application and the new Time\Duration class. Those deserve their own examples. For this upgrade, I would first establish compatibility, then adopt new syntax in a separate change that is easy to review.
There are changes here beyond new language features. The default characters removed by trim(), ltrim() and rtrim() now include form feed. If an importer handles legacy text or preserves control characters deliberately, include those inputs in its fixtures:
$title = trim("\fA Wizard of Earthsea\f");
// PHP 8.6: "A Wizard of Earthsea"Another useful change is that preg_grep() returns false on a PCRE execution error instead of a partial array. Code that assumes every result is an array needs an explicit error path. Try malformed UTF-8 input if your pattern uses the Unicode modifier.
Review custom session handling too. PHP's native session defaults now enable strict mode and HttpOnly cookies, with SameSite set to Lax. Those are PHP session settings; check the effective configuration of your Laravel session driver rather than assuming every framework cookie changes automatically. Embedded integrations and cross-site flows deserve an actual login check.
Returning from a finally block is deprecated. Cleanup should happen there, while the result belongs in the normal control flow. Look especially at older wrappers around file handles, transactions and external services.
The upgrade notes also deprecate nullable return types for __debugInfo(); declare array. Returning values from constructors or destructors is deprecated too. Dependencies may contain these patterns even if your application code does not, so keep deprecation reporting visible in the candidate environment.
Mbregex is deprecated because its underlying Oniguruma library is no longer maintained. If you use those functions for search or import cleanup, plan the migration around representative Unicode inputs. A mechanical function-name replacement is not enough to establish equivalent matching behavior.
Start a branch and record the PHP version, loaded extensions and configuration in both your current environment and the candidate. Keep the application commit and lockfile fixed for the first comparison. Run these through the candidate runtime:
php -v
php --ini
php -m
composer install
composer check-platform-reqs
php artisan testResolve dependency constraints explicitly if installation fails. Keep the current supported PHP version in CI while adding the candidate, and run your existing static analysis there too. For staging, exercise the flows that cross boundaries: uploads, authentication, queued jobs, exports and scheduled commands. Compare errors and deprecations, not just whether the homepage loads.
NativePHP adds another runtime to that list. Updating PHP on your Mac does not update the PHP bundled into a desktop or mobile app. Check what your NativePHP tooling supports, rebuild with the intended runtime and inspect the installed application on each target. Include local database access and plugin-backed flows in that check.
When the final release is available, review its notes against this RC5 snapshot and repeat the checks with the exact build you plan to ship. A useful upgrade is one you can explain: which runtime changed, which incompatibilities you addressed, and which application behavior you verified.