These are the most important innovations



[ad_1]

PHP 8 supports union declarations. (Photo: shutterstock)


Is there no time now?

PHP 8 is finally ready. In addition to an increase in performance via the new just-in-time compiler, developers are also expecting some new features of the language.

Probably the biggest innovation in PHP 8 is the introduction of the new just-in-time compiler. This translates the programs into an intermediate code, which in turn is converted into machine code at runtime (so just in time). This should allow for a significant increase in performance. In practice, however, this only manifests itself under certain conditions.

Don’t miss anything: The t3n newsletter on your favorite topics! subscribe now

According to the open source project, synthetic benchmarks are up to three times faster and some long-running applications are still up to twice as fast as before, but the performance of typical applications, such as WordPress, remains roughly on par with the previous version.

PHP 8: the most important news at a glance

But there are also some innovations in the language itself. PHP 8 now supports attributes, for example, with which structured metadata can be used directly in native PHP syntax. Also new: instead of PHPDoc Annotations you can be native Union-Type– Use declarations for collective declarations.

Thanks to the new addition Named Arguments you can pass input data to a function using the parameter name. The Constructor Property Promotion impact: function saves you from defining Value Objects zukünftig quite a while.

Migrating to PHP 8 requires code changes

Due to some changes, a migration to PHP 8 will not be feasible without code changes. If you migrate from the latest PHP version to version 8, you shouldn’t have any major problems, as the biggest changes were already marked as outdated in previous versions. You can find an overview of all incompatibilities on the official PHP project website.

We have already presented the most important news in advance in our PHP 8 article: these are the plans for the major release.

Most read

[ad_2]
Source link