- Home
- Skills
- Code Quality & Review
- Legacy PHP 5/7 to PHP 8 Upgrade Planner
Works with the AI Agents you already use
Legacy PHP 5/7 to PHP 8 Upgrade Planner
Move an app off end-of-life PHP to a supported PHP 8: quick scan + PHPCompatibility, Rector batches, Composer and framework blockers, test net, staged rollout. READY / UPGRADE WITH FIXES / HIGH RISK.
$14
Legacy PHP 5/7 to PHP 8 Upgrade Planner
Example session with this skill installed
We have a custom PHP 7.2 app (about 80k lines, Composer, CodeIgniter 3, MySQL via mysqli, some old mcrypt code for encrypted customer notes). After PHP2Shell we need to get to a supported PHP 8. Plan it.
- Read your context and instructions
- Compiled the legacy php 5
PHP upgrade plan: customer-portal (2026-10-23)
Verdict: HIGH RISK (bounded). The mcrypt-encrypted data and CodeIgniter 3 are the critical path; everything else is routine.
Current -> Target: PHP 7.2 ->
8.4 (supported on php.net as checked today; the newest branch the dependencies allow, since one PDF library doesn't support 8.5 yet).
Framework: CodeIgniter 3.1.x. Its maintainers state partial PHP 8 support, so we pair the upgrade with patches and plan CI4 separately.
Findings (quick_scan.py, then PHPCompatibility at testVersion 8.4)
| Category | Count | Example | Fix | Auto/Manual | Effort |
|---|---|---|---|---|---|
| mcrypt_* | 14 | app/libraries/Notes_crypt.php:22 | sodium + data migration | Manual | High |
| each() | 37 | application/helpers/legacy_helper.php:88 | foreach | Rector | Low |
| create_function | 6 | application/models/Report_model.php:140 | closures | Rector | Low |
| curly-brace offsets | 52 | multiple | [] | Rector | Low |
| null passed to internal functions (8.1) | ~300 (PHPStan) | strlen(null) patterns | null checks | Mixed | Medium |
| dynamic properties (8.2) | 41 classes | CI3 models | declare properties | Manual + Rector | Medium |
| implicitly nullable params (8.4) | 120 | function x(Foo $a = null) | ?Foo | Rector | Low |
Dependency blockers (composer why-not php 8.4)
| Package | Current | Needed | Notes |
|---|---|---|---|
| tecnickcom/tcpdf | 6.2 | latest 6.x | check the changelog for PHP 8.4 notes |
| phpoffice/phpexcel | 1.8 (abandoned) | phpoffice/phpspreadsheet | API changes in 9 files |
Path
- Contain now (separate skill): isolate the app behind a VPN or WAF while it runs on PHP 7.2.
- Add characterization tests for login, notes, invoices and reports (about 40 tests).
mcrypt plan: decrypt with the old code in a one-off migration on 7.2, re-encrypt with sodium, verify a row-count and checksum sample, keep an encrypted backup. Exit criterion: zero mcrypt calls.
4. 7.2 -> 7.4: Rector PHP 7.4 set, tests green.
5. 7.4 -> 8.4: Rector PHP 8.x sets in batches by directory; fix nulls and dynamic properties by hand; deprecations fail CI.
6. Staging on 8.4 with production snapshot; canary 10% for 48 h; full rollout with the 7.2 container kept for rollback for 1 week.
Timeline (estimate): 3-4 developer-weeks. The biggest uncertainty is how much CI3 needs patching.
Connects securely to your tools. The creator never sees your data.
About this skill
After the October 2026 "PHP2Shell" security release, there is no official fix for PHP 8.1 and older. That leaves thousands of apps stuck on PHP 5.6, 7.x or 8.0/8.1 needing to move to a supported PHP 8 release, fast and without breaking production. The usual approach of bumping the version and seeing what breaks turns into weeks of mystery errors, broken plugins and silent behaviour changes.
This skill gives your coding agent a disciplined upgrade method, a reference of breaking changes for every version step, and a dependency-free quick scanner. It:
- Picks the target from live data (php.net's supported-versions page), constrained by what your framework and key dependencies support
- Assesses the app: runtime, framework and CMS versions, plugins, Composer constraints, extensions (mysql, mcrypt, ereg), tests, CI and deployment
- Triages in seconds with a bundled quick scan for high-impact removed and deprecated features across 7.0-8.4: mysql_*, ereg, the preg /e modifier, mcrypt, create_function, each(), curly-brace offsets, strftime, utf8_encode, "${var}" strings, implicitly nullable parameters and more, with file:line counts
- Confirms with PHPCompatibility (PHPCS) and static analysis, and maps Composer blockers with composer why-not and composer outdated
- Plans the path: version steps with exit criteria, framework-first or PHP-first sequencing, replacements for removed extensions (with a safe plan for re-encrypting mcrypt data)
- Automates safe refactors with Rector in small dry-run-first batches, each committed separately and tested
- Covers manual fixes for behaviour changes that don't throw errors (PHP 8 string-number comparison, null handling in internal functions, dynamic properties), with deprecations turned into CI failures so nothing hides
- Builds the rollout: CI matrix on old and new PHP, staging with production-like data, critical-flow smoke tests, canary or blue/green, rollback and monitoring
- Gives a verdict: READY, UPGRADE WITH FIXES or HIGH RISK, with an effort estimate and the riskiest areas named
For developers, agencies and IT teams with old Laravel, Symfony, CodeIgniter, WordPress, Drupal, Magento or custom PHP apps.
Honest by design: scanner limits are stated, "no issues" is claimed only when scans run clean, framework and PHP support dates are cited rather than recalled from memory, and effort figures are labelled estimates. Pairs with the PHP2Shell Patch and Exposure Check skill for containing the app while the upgrade happens.
Quick scanner is triage only and is confirmed with PHPCompatibility and static analysis. Behaviour changes that don't error need tests to catch. Framework support must be checked against current maintainer statements. Effort is an estimate.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 24 days ago
Requires