Fast. Simple. No meetings. No delays.
Home / Blog / PHP Development / Upgrading From PHP 7 to PHP 8: A Practical Checklist

Upgrading From PHP 7 to PHP 8: A Practical Checklist

A step-by-step checklist for moving an application from PHP 7 to PHP 8: compatibility scanning, deprecations, testing and rollback.

Cover graphic for the article: Upgrading From PHP 7 to PHP 8: A Practical Checklist

To upgrade PHP 7 to PHP 8 safely, inventory your extensions and libraries, run an automated compatibility scan, fix the breaking changes, test on a staging copy that matches production, then deploy with a rollback plan. This checklist follows that order. Confirm details against the official php.net migration guides, since versions and support dates change.

Why upgrade PHP 7 to PHP 8 now

PHP 7 releases are no longer supported with security fixes, so an application still running on them depends on a runtime that will not be patched if a new vulnerability appears. Newer libraries and frameworks also drop older PHP versions, which gradually blocks you from updating anything else. PHP 8 brings a number of language improvements and stricter, safer behaviour, and many applications see performance benefits without code changes, though results vary by workload.

Check the supported-versions page on php.net for the current status before you plan, and choose a target release that is still supported rather than the oldest 8.x. Upgrading in stages, 7.4 then 8.0 then onward, is often easier than one jump, because each step surfaces a smaller set of problems. This article was written in 2026; treat version specifics as a prompt to check the official source.

Inventory: extensions, libraries, hosting

List everything the application depends on before you touch the code.

  • PHP version and extensions in use. Run php -m and compare with what the code needs. Note any extension that is removed, replaced or not yet available for your target version.
  • Composer dependencies. Review composer.json and composer.lock. For each package, find the release that supports your target PHP version. The command composer why-not php 8.x (with your target) can point to blockers.
  • Framework and CMS versions. An old framework or plugin may not support PHP 8 at all, which turns the PHP upgrade into a framework upgrade as well.
  • Vendored or hand-copied libraries. Code pasted into the repository is the most likely to break and the easiest to forget.
  • Hosting. Can your host or server provide the target version, and run it side by side with the old one for testing? Check php.ini settings, FPM pools and cron jobs that call the command-line version.
  • Other consumers. Scheduled scripts, queue workers and deployment tools may use a different PHP binary from the web server.

Automated compatibility scanning

Let tools find the mechanical issues first, so humans can focus on behaviour.

  1. Run php -l on every file with the target version to catch syntax errors.
  2. Run PHP_CodeSniffer with the PHPCompatibility standard, set to your target version, to flag removed functions, deprecated features and changed behaviour.
  3. Use a static analyser such as PHPStan or Psalm to find type problems and calls that would now throw errors.
  4. Consider an automated refactoring tool such as Rector, which has rule sets for PHP version upgrades, and review every change it proposes.
  5. Turn on full error reporting in a development copy, including deprecation notices, and click through the application while watching the logs.

Treat the scan output as a work list, not as proof. These tools miss dynamic code, such as calls built from strings, and anything inside templates or configuration.

Common breaking changes

The specifics are in the php.net migration guides, but these categories cause most trouble when moving to PHP 8:

  • Stricter internal function arguments. Passing the wrong type, such as null to a function that expects a string or an array to one that expects a scalar, now often raises a TypeError or a deprecation notice where PHP 7 let it pass.
  • Changed string and number comparison. Loose comparisons between numbers and non-numeric strings behave differently, which can alter conditions that used to be true.
  • Warnings instead of notices. Undefined variables, array keys and properties are reported more loudly, exposing sloppy code and filling logs.
  • Removed features. Some long-deprecated functions and syntax are gone, for example the old curly-brace string offset syntax and the each function.
  • Stricter class and method rules. Signature compatibility between parent and child methods is enforced more strictly, and old-style constructors named after the class no longer work.
  • Library and extension changes. Some extensions changed object types or return values, which matters for code using them directly.
  • Error handling. Some conditions that returned false or emitted a warning now throw exceptions, which can surface in code that never expected them.

Testing strategy

The safest upgrade has automated tests. If you have them, run the suite on the target version and fix failures one at a time. If you do not, build a small safety net first: tests, or at least scripted checks, around your most important flows such as login, ordering, payments, reports and imports. A modest set of tests on critical paths is worth more than none.

  • Build a staging environment that matches production in PHP version, extensions and configuration.
  • Use a copy of realistic, anonymised data, so edge cases appear.
  • Test scheduled jobs, emails, file uploads, PDF generation, and any integration with external services.
  • Watch error logs during testing and after, including deprecation notices you decided to defer.
  • Ask a real user of the system to walk through their daily tasks.

The old PHP version and the new one should be able to run in parallel on the server, so you can compare behaviour. For older codebases that need more than a version bump, see our piece on modernizing a legacy PHP application and the Australian view in upgrading an old PHP application in an SME.

Deployment and rollback

  1. Take a full backup of code and database and verify you can restore it.
  2. Choose a quiet window and tell the people who use the system.
  3. Deploy the code changes first, if they are compatible with both old and new PHP versions, so the risky moment is only the version switch.
  4. Switch the PHP version for web, command-line workers and cron together.
  5. Run smoke tests on the critical flows straight away.
  6. Keep the previous PHP version installed and the switch reversible, so rollback means changing a setting, not rebuilding a server.

Decide in advance what counts as a reason to roll back, such as failed logins or errors on payment, so nobody has to debate it under pressure.

After the upgrade

  • Monitor logs and error tracking closely for the first days and weeks.
  • Clean up deferred deprecation notices before the next version arrives.
  • Remove compatibility shims and old workarounds that are no longer needed.
  • Add your PHP version and its end-of-support date to a maintenance calendar, so the next upgrade is routine. Our guide on keeping a PHP or Laravel application healthy covers that rhythm.
  • If you use Laravel, continue with the framework layer; see how to upgrade an old Laravel application safely.

If you want help planning the work, our software development for Australian businesses page describes how remote engagements run, and you can contact us to talk through an application.

Frequently asked questions

What breaks most often moving to PHP 8?

Usually stricter argument types for built-in functions, such as passing null or arrays where strings are expected, plus changed loose comparisons, new warnings for undefined variables and keys, removed legacy functions, and plugins or libraries that never added PHP 8 support. Check php.net's migration guide for specifics.

Can I upgrade without tests?

You can, but it is riskier. Build a minimal safety net first: scripted checks or tests around login, payments, key reports and imports, and run a staging copy with realistic data. Keep the old PHP version available so rollback is quick.

Which tools find incompatibilities?

PHP's own lint check, PHP_CodeSniffer with the PHPCompatibility standard, and static analysers such as PHPStan or Psalm catch many issues. Rector can automate some fixes. None finds dynamic code or template problems, so combine them with testing and log review.

Related articles

PHP Development USA

Scaling a PHP Application for Higher Traffic

Where PHP applications actually hit limits — database queries, sessions, caching and file storage — and the fixes in the order that pays off.

5 min read

🚀 Start Now