← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

PHP Version Upgrade Checklist

PHP PHP 5.0+ Intermediate
debt(d7/e5/b3/t5)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). Rector and PHPStan can flag some deprecations, but the checklist itself (staging test, OPcache clear, dep check) is a process not detectable by tools; detection_hints.automated is no.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix lists a multi-step process (fix deprecations, check deps, run Rector, staging test) which typically touches many files across the app to resolve deprecations and incompatible APIs.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3). The checklist is a periodic devops process applied at upgrade time; it doesn't shape day-to-day code but imposes ongoing maintenance discipline (fixing deprecations as they appear).

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap most devs eventually learn' (t5). Misconception that you can upgrade PHP directly is a well-known gotcha; OPcache not being cleared and Composer dep mismatches are documented surprises devs learn after being burned once.

About DEBT scoring →

TL;DR

A systematic PHP upgrade process: check EOL status, run static analysis, update Composer deps, run Rector, test on new version in staging, then deploy — never upgrade directly in production.

Explanation

PHP upgrade checklist: (1) Check current version EOL at php.net/eol. (2) composer outdated — update dependencies for new PHP version. (3) Run PHPCompatibility PHPCS to find incompatible code. (4) Run Rector for automated migration. (5) Enable E_ALL in dev and fix all notices/warnings/deprecations on current version first. (6) Set up staging environment with new PHP version. (7) Run full test suite. (8) Run with new version in shadow/canary mode. (9) PHP-FPM: update pool config for new version. (10) Monitor error logs after deployment. OPcache: clear after upgrade. JIT: reconfigure if used. Extensions: verify all needed extensions are available in new version.

Common Misconception

You can upgrade PHP directly in production — always test on staging first. PHP upgrades can break framework version requirements, extension APIs, and third-party libraries.

Why It Matters

A structured upgrade process prevents production incidents — PHP version upgrades are the highest-risk maintenance operation for a PHP application.

Common Mistakes

  • Upgrading PHP without first fixing all deprecation warnings on the old version.
  • Not checking Composer dependency compatibility before upgrading.
  • Forgetting to clear OPcache after PHP version change.

Code Examples

✗ Vulnerable
# Dangerous: direct prod upgrade without testing:
sudo apt-get install php8.3-fpm
sudo service php8.0-fpm stop
sudo service php8.3-fpm start
✓ Fixed
# Safe upgrade process:
# 1. Fix deprecations on current version:
php -d error_reporting=E_ALL -d display_errors=1 index.php

# 2. Check deps:
composer check-platform-reqs --php-version=8.3

# 3. Run Rector:
vendor/bin/rector process --dry-run

# 4. Test on staging with new PHP
# 5. Monitor for 24h, then prod rollout
# 6. Clear OPcache after deploy

Added 23 Mar 2026
Views 52
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 1 ping T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 2 pings F 1 ping S 0 pings S 4 pings M 2 pings T 4 pings W 0 pings T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 1 ping W 0 pings T 0 pings F 1 ping S 0 pings S 0 pings M 1 ping T 0 pings W
No pings yet today
Bing 1
Scrapy 8 Amazonbot 7 ChatGPT 6 Google 4 Ahrefs 3 SEMrush 3 Meta AI 2 Perplexity 2 Bing 2 Unknown AI 1 Claude 1
crawler 35 crawler_json 3 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: High
⚡ Quick Fix
Follow the checklist: fix deprecations → check deps → run Rector → test on staging → deploy → clear OPcache. Never skip the staging step.
📦 Applies To
PHP 5.0+ web cli queue-worker
🔗 Prerequisites
🔍 Detection Hints
Auto-detectable: ✗ No rector phpcs phpstan
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: High Context: File Tests: Update


✓ schema.org compliant