Deprecations in PHP 8.4: what to prepare for and what will be removed in June 2025

20.06.20253 min read
Makar Kucherenko
Python developerMakar Kucherenko

Each PHP update is not only long-awaited new features, but also a headache for projects in which technical debt (Legacy) has not been resolved for years. The summer release candidate of PHP 8.4 gave a clear picture: the language continues its course towards the most severe strong typing.

Let's look at what features you'll have to get rid of before the final release, and what new things have been brought in for data architects.


1. Strict type mutation: End of implicit Float → String

For a long time, PHP forgave "dirty" mathematics. Before 8.4, the code below worked without warnings:

$taxRate = 19.5;
echo "Налог составляет " . $taxRate . "%";
// Неявное преобразование Float в String

In PHP 8.4 this will call Deprecation Notice. The kernel requires strong typing when concatenating or deducing fractional numbers. It is now the responsibility of the developer to explicitly format the numbers, otherwise in the future (in PHP 9.0) this will become a Fatal Error:

// Правильный подход в 8.4+:
echo "Налог составляет " . number_format($taxRate, 1) . "%";

2. Global cleaning of modules (What will be permanently deleted)

By the summer of 2025, a number of obsolete functions were blocked in RC versions of 8.4. If your project is tied to them, it’s time to refactor.

  • mbregex_encoding() — Removed: The old mechanism for working with multibyte regular expressions has been scrapped. Instead, you must use standard mb_ functions.
  • Death of old MySQLi logic: Method mysqli::get_result() now strictly requires explicit initialization for unbuffered requests. Many old ORMs (home-written) will stop working or start throwing Warnings.

🛠️ DevOps Tip: Update the Composer package manager to at least version 2.7. New versions of Composer can parse composer.json for future-flag compatibility with PHP 8.4 and warn in advance about dependency conflicts.

Free SEO audit of your website

Leave a request and our specialists will find areas of search traffic growth.


3. Readonly Classes: Adaptation Frameworks (Laravel / Symfony)

Since version 8.2 we got readonly classes, but in 2025 they became the de facto industry standard for working with Event Sourcing and DTO.

final readonly class AppConfig {
    public function __construct(
        public string $dbHost,
        public string $dbName
    ) {}
}

In the summer updates, Doctrine ORM and Laravel Eloquent finally rolled out native Hydration mechanisms for such immutable objects. Now frameworks can directly reflect (ReflectionClass::newInstanceWithoutConstructor) data from the database directly into protected ones readonly properties that bypass magic __set.

Productivity array_map and array_reduce in such rigid structures was optimized by the kernel up to +12%.

Free project cost estimate

Answer 4 questions and we will send you a range of prices to suit your needs.

1. What type of corporate website do you need?


Checklist: how to prepare code for PHP 8.4

To prevent the transition from becoming a disaster for production, follow these 3 steps:

  1. Bring up a test loop in Docker with an image php:8.4-rc-cli.
  2. Run your unit tests (PHPUnit/Pest). Collect everything carefully E_DEPRECATED messages in logs.
  3. Run your code through a static analyzer (PHPStan level 8) - it will proactively find all weak type conversions and deprecated functions.

Backend engineering team NBM-IT audits legacy code. We take care of the safe migration of complex corporate systems from PHP 7.x to current versions 8.3/8.4, closing potential backdoors (CVE) and speeding up systems.

Useful on the topic

Leave your contacts - we will call you back, sort out the problem and offer the best way. We have more than 350 projects behind us, each of which we launched with an individual approach. We guarantee expert advice during business hours.