PHP 7.4
PHP 7.4 is a release of the PHP language shipped in November 2019, the last in the 7.x branch. It rounded off the series that defined modern, high-performance PHP and laid the groundwork for the groundbreaking PHP 8 series. Among other things, it introduced typed class properties and concise arrow functions.
Why PHP 7.4 mattered
PHP 7.4 focused on further developing typing and performance:
- typed class properties — the ability to declare a type directly on an object's fields;
- arrow functions — a concise way to write short closures with automatic access to variables from the enclosing scope;
- preloading — loading selected files into OPcache at server startup, further speeding up applications;
- the null coalescing assignment operator (??=) — a concise way to assign a default value.
For a long time PHP 7.4 was the most commonly chosen version in production environments, valued for its stability and broad compatibility with popular content-management systems and frameworks.
Practical applications
Support for PHP 7.4 ended in November 2022, so it is no longer safe to run in production. Because it was so popular, its retirement became one of the more common reasons for planned migrations to the PHP 8 series. Applications running on 7.4 should be updated to PHP 8.0 or later. Modern hosting and VPS servers offer only supported PHP releases, allowing a smooth move to a current branch.
Why 7.4 was so popular
PHP 7.4 earned the status of one of the best-liked versions because it combined the maturity and stability of the 7.x series with a set of modern features that hinted at the direction of the 8 series. Typed properties and arrow functions significantly improved code ergonomics, while the version remained fully compatible with a huge number of existing libraries. For many teams it was a natural production base right up until the ecosystem had fully adapted to the requirements of the 8 series.
Powiązane pojęcia
Najczęstsze pytania
Is PHP 7.4 still safe to run in production?
No. Active and security support for PHP 7.4 ended in November 2022, so the version no longer receives patches. Applications running on 7.4 should be migrated to a supported PHP 8 branch to avoid exposure to known vulnerabilities.
