PHP 8 - Release

Update on December 24, 2020

In November 2020, version 8 of PHP was released, which brings with it several changes, improvements and new ones.

The most important changes are the following

JIT (Just In Time Compilation)

PHP is a non-compiled language like Java or other programming languages, but with this new version a compiler appears for the first time, and its strength is based on multiplying by four the performance of some types of tasks, especially those that demand many resources of the CPU.

Union Types

One of the most demanded features since we began to be able to "type" the arguments of functions and methods was the possibility of specifying several types for an argument and the return of a function. The “union types” are a collection of two or more types so that we indicate that any of them is valid when we specify the value of that argument or the return type of the function.

Promotion Construct Properties

This feature allows us to define the scope of a property through constructor arguments so that they are initialized in the class and this entails fewer lines of code.

Named Arguments

This is similar to what Phyton offers through keyword arguments, and you can now use arguments through their names.

Nullsafe operator

With this new operator you will not have several if conditionals to check if you have null values, all you have to do is use it.

the truth is that, from this, more than benefiting the classes of web applications based on PHP (such as, for example, Wordpress), what it does is above all open new possibilities to PHP as a general-purpose programming language, allowing it to be used in fields such as machine learning.

At the moment I recommend not updating to this version, I do not mean that it is bad but that you have to wait for it to be stable.