The most common way a PHP upgrade fails is not technical. It is a branch called
php8-upgrade that was created eight months ago, has four hundred commits, and
conflicts with everything.
Why the big-branch approach fails
An upgrade branch competes with ongoing development, and it always loses. The main branch keeps moving, the upgrade branch keeps rebasing, and the cost of merging grows faster than the work gets done. Eventually someone calculates the remaining effort, the number is alarming, and the branch is quietly abandoned.
The fix is not more discipline. It is to make the work mergeable in small pieces from the start.
Make the code run on both versions first
Most of the work in a version upgrade is not version-specific. Removing calls to functions that were deprecated, adding explicit types where implicit coercion used to happen, fixing places where the code relies on behavior that changed, almost all of that is valid on your current version too.
So do it there. Each change is a normal pull request, reviewed and deployed normally, with no branch to maintain. By the time you actually flip the version, the diff is small enough to read in one sitting.
The sequence that tends to work:
- Establish coverage on the paths you are about to change. Not everywhere: just where you are going to be working.
- Clear deprecations on the current version, one category at a time.
- Update dependencies to releases that support both the old and new PHP. This is usually the longest phase and the one that surfaces genuinely abandoned packages.
- Run the test suite on the new version in CI, allowed to fail, so the remaining gap is visible and shrinking.
- Flip the version once that job is green. This step should be boring.
The dependency problem is the real problem
Language changes between PHP versions are documented and largely mechanical. Your dependency tree is neither. The packages that block upgrades are the ones that were abandoned, and every one of them is a decision: replace it, fork it, or absorb it into your codebase.
Make those decisions early, in the assessment, not in month six. An upgrade estimate that has not enumerated the abandoned dependencies is not an estimate.
What "done" looks like
The upgrade is finished when the version has flipped in production and the deprecation warnings from the next version are already being cleared. Teams that treat an upgrade as a one-time project end up doing this again from scratch in three years. Teams that fold it into normal maintenance find the next one takes weeks instead of quarters.