Chat on WhatsApp

PHP 8.3 requirement — what does it actually break?

Magento 2.4.8+ requires PHP 8.3. The most common breakages I see when teams bump from 8.1/8.2 → 8.3:

  • Dynamic property deprecation (PHP 8.2+, error in 8.3). Custom modules that set $this->something = $foo on a class without declaring the property break. Fix: declare every property explicitly, or use #[\AllowDynamicProperties] as a band-aid.
  • Implicit nullable parameter types deprecated. function foo(string $bar = null) now needs ?string $bar = null. Common in older custom modules and 2.3-era extensions.
  • Untyped properties / methods. Several Magento core classes added strict types in 2.4.8; any vendor module overriding them needs matching signatures.
  • Removed functions. utf8_encode() and utf8_decode() are gone (deprecated in 8.2). Use mb_convert_encoding() instead. Old extensions use them everywhere.
  • Random number generator changes. mt_srand() behaviour changed. Anything using PHP RNG for security tokens needs review (you should be using random_bytes anyway).
  • SimpleXML quirks. A few SimpleXML edge cases changed in 8.3. Layout-XML loaders sometimes need patches.

Pre-flight script before upgrade: run vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 8.3 app/code/ over your custom code and audit every warning.

Was this helpful?