Orofold Labs

Launching soon

Notes Get in touch

Engineering 4 min read Updated

Planning a PHP version upgrade

In short

Plan an upgrade around the support dates and the changes that affect your code, and keep a way back to the previous version.

Every PHP version has a support end date, and that date sets the timetable for an upgrade. Start with the support table, then scan the list of incompatible changes for the code you own. Roll the upgrade out in small steps that can be reversed. The reference points are the PHP Group’s supported versions page and the PHP 8.5 backward-incompatible changes.

Read the support dates, not the version numbers

The supported versions page lists each branch with its dates. On 24 November 2026 it shows the following:

VersionActive support untilSecurity support until
8.231 December 202431 December 2026
8.331 December 202531 December 2027
8.431 December 202631 December 2028
8.531 December 202731 December 2029
8.631 December 202831 December 2030

Two rows matter for planning. Version 8.2 receives security fixes only, and its security window closes at the end of 2026. Version 8.4 leaves active support at the end of 2026 and keeps receiving security fixes until the end of 2028. Version 8.6, released on 19 November 2026, has the longest remaining window in the table. Read the dates as they stand on the day you plan, because the table changes as branches age.

Scan the incompatible changes against your code

The PHP 8.5 page lists its changes by extension. Most will not touch a given project, so search the list for the parts your code actually uses. Three examples show the kind of change to look for:

  • Sessions. Writing a $_SESSION key that contains the pipe character now emits a warning, where it used to fail silently.
  • PDO. Constructor arguments passed with PDO::FETCH_CLASS now follow the usual call_user_func_array semantics. Calling setFetchMode() during a fetch throws an Error.
  • Settings and build. The disable_classes setting has been removed, and Opcache is always built in.

Also check for casts. A warning is now emitted when a float, or a string that looks like a float, is cast to int and cannot be represented as one. A search of your own code for these names and settings takes minutes, and it usually finds more than reading the full list.

Working on something similar in your own product? A few honest sentences are enough – we read every enquiry and reply by email. Apply with your idea

Test on a copy before you move

Run the existing test suite under the new version, and read the log for new warnings as well as for failures. A warning is often the first sign of a change that would break later. Use a staging copy with the same PHP version, extensions and configuration as production, as described in staging environments. Without automated tests, the minimum is a short list of main journeys, such as logging in, searching and checking out, run by hand on the new version. That minimum is general practice rather than a requirement from the sources.

Roll out in small, reversible steps

Change one thing at a time. Move the PHP version first, then the code that depends on it, rather than both together. Keep the previous version available so that you can switch back quickly, and watch the error log through the first hours after the change. How to define and test a rollback is covered in releases and rollbacks. The rule of small steps is general practice.

A practical upgrade checklist

Work through these steps in order:

  1. Confirm that the target version is in active or security support on the supported versions table.
  2. Scan the incompatible changes for the functions, extensions and settings your code uses.
  3. Check that your dependencies support the target version, and update those that do not. Dependency handling is covered in keeping dependencies up to date.
  4. Run the tests on a staging copy with production configuration, and read the warning log.
  5. Deploy to a small part of the live system first, then to the rest.
  6. Keep the old version ready for a rollback, and record the date on which you will remove it.

Support dates come from the PHP Group table as it stood on 24 November 2026. Check the live page before you plan a date. The list of changes is taken from the PHP 8.5 migration guide; it is not a full review of your code.

Sources and limits

Common questions

Which version has the longest support left?
On the PHP Group table as it stood on 14 November 2026, version 8.5 has security support until 31 December 2029, the longest window listed. Version 8.2 receives security fixes only, until 31 December 2026.
Which kinds of change should I search for first?
Start with the parts your code uses. In PHP 8.5, writing a $_SESSION key that contains the pipe character emits a warning, and constructor arguments passed with PDO::FETCH_CLASS follow call_user_func_array rules.
Do casts to int need checking?
Yes. PHP 8.5 emits a warning when a float, or a string that looks like a float, is cast to int and cannot be represented as one.

Sources

  1. Supported Versions, PHP Group (php.net). Accessed 24 November 2026
  2. Backward Incompatible Changes (PHP 8.5 migration guide), PHP Group (php.net). Accessed 24 November 2026

Further reading

Have an idea that should exist? Or a working product that needs more customers, a new website or a complete rework? Bring us anything. Apply with your idea

All notes