Skip to main content

PHP Version Upgrade Checklist

A pre-flight checklist for major PHP version upgrades. It covers static analysis, dependency and extension compatibility, stricter error handling, and staged rollout.

Estimated Time
3-5 days
Type
pre flight
Category
Programming Language
Steps
12

When to Use This Checklist

Use this checklist before upgrading a PHP application across a major version, such as PHP 7 to 8. Major PHP releases tighten type handling, promote warnings to exceptions, and occasionally remove functions. Frameworks like Laravel and CMS platforms like Drupal track PHP versions closely, so the runtime and framework upgrades often move together.

How to Use This Checklist

Start with discovery and a static analyzer such as PHPCompatibility or Rector, which flag most breaking changes automatically. Establish a green test baseline and audit Composer dependencies and PECL extensions for target-version support. The most error-prone change in PHP 8 is stricter error handling: warnings that code silently ignored now throw. Re-run the full suite on the target version before rollout.

Ship behind a canary or blue-green deployment with the prior runtime ready to restore.

What Good Looks Like

A clean upgrade has a static-analysis report addressed, every Composer package and PECL extension on a compatible version, and stricter error handling accounted for. The test suite is green on the target version, dependency scans are clean, and the release rolls out behind a canary with rollback available.

Common Pitfalls

The most common surprise is PHP 8 turning previously silent warnings into fatal errors that only appear at runtime. Teams forget PECL extensions need separate builds. Upgrading the framework and runtime out of step causes compatibility deadlocks. As always, skipping a baseline test run hides whether failures are new.

Related Resources

See the test pyramid for your safety net, static application security testing in CI for dependency scanning, and canary release and blue-green deployment for safe rollout.