PHP 7.4: The new version of the web programming language is not a routine update

The PHP project has released version 7.4 just in time for the announced date. This is the last minor version before the release of PHP 8.

In addition to general enhancements and bug fixes, PHP 7.4 has three features that give it an outstanding position among the so-called point updates.

Preloading accelerates code execution

The introduction of the so-called preloading, which is supposed to replace the autoloading known since PHP 5.0, is likely to generate the most noticeable external impact. The main difference to the previous caching is that with preloading code units such as classes, interfaces and traits are available directly at the beginning of the program execution and do not have to be loaded first and then held.

This is done using the so-called OPCache, which loads a previously specified PHP script onto the user’s hard disk and stores it there. This poses a number of challenges when it comes to deployment in production applications.

Typed Properties Extend PHP Type System

For everyday programming, the “Typed Properties 2.0”, an addition to the type system that has been continuously expanded since version 5, are of great relevance. Developers can now also enter the properties of a class, which saves them having to write getter and setter methods for type checking, also known as boilerplate code. The feature had been discussed in the run-up to the release and was approved by a large majority.

FFI allows use of C libraries

Developers who also know C may be pleased with the introduction of the Foreign Function Interface (FFI). This PHP extension allows you to load shared libraries that call C functions or access C data structures. Thus the integration takes place directly. The C code is written into an FFI object without intermediate steps. The PHP project at CFFI for Python copied the design of the FFI.

Last point update before PHP 8

Of course, the new features mentioned are not the only ones introducing PHP 7.4, but only the most important in our opinion. You can read all improvements and new functions here.

PHP 7.4 is the last point update before the introduction of the longed-for version PHP 8, which is expected to provide a further performance boost through the integration of the JIT compilers (Just-in-Time). You can read about the features planned for PHP 8 so far here.