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

Deprecation Notices & Migration Strategy

PHP PHP 5.0+ Intermediate
debt(d5/e5/b7/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The term's detection_hints.tools lists rector, phpstan, and psalm — all specialist static analysis tools. Deprecations do emit E_DEPRECATED at runtime, but only if error_reporting is configured correctly (a common mistake is suppressing them). They won't surface as compiler/syntax errors or via default linters, so d5 is the right anchor.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix mentions running Rector to auto-fix deprecations, but common_mistakes highlight that ignoring deprecations across a codebase leads to accumulated changes spanning multiple files and components before a major version upgrade. While Rector automates some fixes, the overall migration process (auditing, fixing, verifying CI) across a full codebase is a multi-file effort, pushing it to e5 rather than e3.

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

Closest to 'strong gravitational pull' (b7). The why_it_matters field explicitly states that deprecations compound — each ignored notice becomes a potential breaking change at the next major release. This applies across both web and cli contexts (applies_to is broad). The structural weight is high because every future upgrade decision is shaped by the accumulated deprecation debt, and teams must constantly work around or address it.

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

Closest to 'serious trap' (t7). The misconception field states directly: 'Deprecation notices are just warnings — they can be safely ignored until the next major version.' This contradicts how deprecations actually behave (they become breaking changes), and developers familiar with other ecosystems where warnings are truly advisory will be misled. The common mistake of suppressing E_DEPRECATED reinforces this trap, making it a serious cognitive hazard that contradicts reasonable expectations.

About DEBT scoring →

TL;DR

E_DEPRECATED warnings signal features removed in the next PHP major version — treating them as errors in CI prevents upgrade blockers from accumulating.

Explanation

PHP uses E_DEPRECATED to warn that a function, parameter, or behaviour will be removed in a future version. E_USER_DEPRECATED is the user-land equivalent. In PHP 8.x, many PHP 7.x patterns trigger deprecations (dynamic properties, ${} string interpolation, implicitly nullable parameters). Best practice: set error_reporting(E_ALL) in dev to surface them, use PHPStan/Psalm to catch them statically, and use Rector to auto-fix them. Run php -d error_reporting=32767 in CI to catch all notices. Never suppress deprecations with @.

Common Misconception

Deprecation notices are just warnings — they can be safely ignored until the next major version. Ignoring them creates a wall of breaking changes at upgrade time.

Why It Matters

Deprecations compound — each ignored notice becomes a potential breaking change at the next major release, making upgrades exponentially harder.

Common Mistakes

  • Suppressing deprecations with @ operator or error_reporting(~E_DEPRECATED).
  • Not running Rector to auto-fix deprecations before upgrades.
  • Upgrading PHP major versions without first eliminating all deprecations on the previous version.

Code Examples

✗ Vulnerable
// PHP 8.2: Dynamic properties deprecated
class User {
    // No typed properties defined
}
$u = new User();
$u->name = 'Paul'; // Deprecated: Creation of dynamic property
✓ Fixed
// Fix: declare the property explicitly
class User {
    public string $name = '';
}

// Or add attribute to acknowledge intentional dynamic properties (PHP 8.2+):
#[\AllowDynamicProperties]
class LegacyUser {}

Added 22 Mar 2026
Views 76
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 5 pings F 1 ping S 2 pings S 4 pings M 2 pings T 1 ping W 3 pings T 2 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 1 ping M 1 ping T 0 pings W
No pings yet today
PetalBot 1
Scrapy 16 Google 10 Amazonbot 10 Perplexity 6 SEMrush 5 ChatGPT 4 Unknown AI 4 Ahrefs 3 PetalBot 3 Claude 1 Bing 1 Meta AI 1 Sogou 1
crawler 60 crawler_json 4 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Low
⚡ Quick Fix
Run error_reporting(E_ALL) in dev, use Rector to auto-fix deprecations, and ensure CI fails on E_DEPRECATED. Fix all deprecations before upgrading PHP major versions.
📦 Applies To
PHP 5.0+ web cli
🔗 Prerequisites
🔍 Detection Hints
E_DEPRECATED
Auto-detectable: ✓ Yes rector phpstan psalm
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Low ✓ Auto-fixable Fix: Low Context: File Tests: Update


✓ schema.org compliant