Newest PHP 05 Newest Php

Newest PHP 05 Newest Php

New Features in PHP 8 - Nathan Barlow

Feature 1: Named Arguments

PHP 8 adds support for named arguments. This addition means that values can be passed into a function by specifying their name. They can then be used in the function, and it doesn't matter which order the parameters were given in.

Feature 2: Performance/JIT

PHP 8 uses a new compiler called "JIT" (just in time) which promises significant performance improvements. PHP is an interpreted language, meaning it is translated to code that can be read by the CPU at runtime. JIT can optimize performance by compiling parts of the code by looking for parts of the code that are re-executed. Then, these precompiled versions can be used instead of the real code.

Feature 3: Match Expression

PHP 8 introduced a new expression: match. It is comparative to the switch expression, but makes several improvements. The "match" can combine switch conditions so they are not all separate, doesn't require a break statements, and returns a value. Instead of setting a variable to a given value several separate times, the assignment only needs to be made once: at the beginning.

Summary of the Documentation

PHP 8 offers many new improvements for PHP users. Not only are there more options for coders to use, but the speed and performance has improved as well. These are just a few of the new features: more can be found by visiting stitcher.io or the official release page.