Prepare Your Code for PHP 9: PHP 8 Deprecations Explained
summary
Overview of concrete PHP 8 deprecations and how to fix them: core functions like UTF8 encode/UTF8 decode and legacy mhash/LCG functions are removed in favor of mbstring and the random extension; curly-brace array access and string increment/decrement become errors with replacement APIs; fputcsv’s escape default is dropped so callers must pass it or use named params; dynamic properties require allow_dynamic_properties or explicit class fields; directives (filter.default, session, disabled_functions) and assertion options change. Static analysis, grep/replace, Rector and named parameters are recommended; expect ~325 deprecations with 5–10% likely to bite.
AI-written summary · about
chapters (27)
- 0:00PHP 9 preparation intro
- 4:16PHP deprecations in practice
- 7:07Deprecated PHP features
- 8:32PHP 8.3 deprecated functions
- 10:41Random number generator removed
- 12:25FTP resource transitions
- 14:12Assert options removed
- 15:57Gutted features in code
- 18:27Deprecated constants
- 21:35Deprecated classes/interfaces
- 22:42Deprecated variables/operators
- 24:11Deprecated PHP directives
- 27:01Disabled classes/functions removed
- 29:08Assert function changes
- 30:35CSV escape parameter change
- 33:04Modernizing with optional params
- 37:00Typed array keys
- 40:13Dollar-curly-brace syntax
- 42:27Null to string parameters
- 44:35MB string encoding updates
- 47:00Dynamic properties deprecation
- 52:39Nullable parameters fixes
- 54:03False vivification behavior
- 55:28Underscore class name
- 56:31Sort comparison function changes
- 58:18Switch colon to semicolon
- 1:00:05String increment/operators removed








