New PHP 8.4 Standard: Key Changes and the Future of the Language

Online Python Trainer for Beginners

Learn Python easily without overwhelming theory. Solve practical tasks with automatic checking, get hints in Russian, and write code directly in your browser — no installation required.

Start Course

New PHP 8.4 Standard: What Awaits Developers



The developer community is eagerly awaiting the release of PHP 8.4 — the next major update to the popular server-side language. The release is scheduled for November 21, 2024, but the key innovations that will change the approach to writing code can already be assessed. In this article, we will break down the most significant changes that the new PHP standard will bring.



Property Hooks: Long-Awaited Conciseness

One of the most discussed innovations is property hooks — a mechanism that allows overriding the behavior of class properties without writing cumbersome getters and setters. Now developers can write property access logic directly in its declaration:



class User {    public string $name {        set => ucfirst($value);        get => $this->name ?? 'Guest';    }}


This simplifies the code, makes it more readable, and eliminates unnecessary boilerplate. Property hooks work with types, attributes, and support inheritance.



JIT Compiler Improvements

In PHP 8.4, the development team continued optimizing the JIT (Just-In-Time compilation). Thanks to the new algorithm, performance in computationally intensive tasks (image processing, encryption, mathematical calculations) has increased by 15–20% compared to PHP 8.3. For web applications operating under high load, this means faster response times and reduced server resource costs.



Attributes Become More Powerful

Attributes (annotations) in PHP 8.4 have gained new capabilities. They can now be applied to function parameters as well as class constants. This opens the door to more flexible routing, validation, and auto-configuration in frameworks (Laravel, Symfony).



Deprecated Functions and Backward Compatibility

As with any major version, some functions are marked as deprecated. Among them:

  • The call_user_method() function (completely removed)
  • The PHP_INT_SIZE constant in some contexts
  • The each() and sizeof() aliases

Developers are advised to check their projects for compatibility in advance using tools like Rector or PHPStan. Migrating from version 8.3 to 8.4 will take no more than a few hours if the code is written in compliance with modern standards.



What Does This Mean for Web Developers?

The new PHP 8.4 standard is not just a set of syntactic sugar. Property hooks and the improved JIT make the language more competitive compared to Python and Go. For an educational context (the PythonLib site), it is important to note: if you are learning PHP after Python, you will find that modern PHP is increasingly adopting concise constructs from other languages. This lowers the entry barrier and makes PHP attractive for backend development of microservices and APIs.



Transition Recommendations

  • Update your local environment to PHP 8.4 RC (release candidate) for testing.
  • Run a static code analyzer (PHPStan, Psalm) at level 9.
  • Check the compatibility of the Composer packages you use.
  • Replace deprecated functions with modern alternatives.


PHP 8.4 is a step towards more

Recommended Libraries