DEV Community

Vikas Verma
Vikas Verma

Posted on • Edited on

What are the important updates available in PHP8?

The latest update of PHP 8 comes after 5 years of the release of PHP 7. PHP8 contains many new features and improved performance than former versions. While there are not many revolutionary changes in the language, a lot of improvement can be seen in PHP 8. Many changes, including named arguments, union types, attributes, constructor property promotion, match expressions, throw expressions, null safe operator, JIT, and improvements in the type system, error handling, and consistency are pathbreaking.

The two changes in the PHP 8 language are:

JIT ( Just in Time) compiler

It speeds up more complex, longer-running scripts improving code execution performance. The JIT Compiler in PHP 8 shows improved performance by more than 45 per cent as compared to earlier versions. The improved capability of PHP in high-computer environments, make it possible for using PHP beyond just web development, like IoT deployments to machine learning models. For instance, the JIT compiler and the OPcache exte when used together will eliminate the need to load and parse scripts on every request.

Tidy comparison operator

Better comparisons fix frequent bugs and also comparisons between numbers and non-numeric strings are possible now.

Streaming from version 7.4 to 8 without JIT does not make an important difference, the difference to version 8 with JIT is significant. The JIT Compiler improves performance by further than 45 per cent.

Piecemeal from the new features introduced in PHP8, some functions and features that were disapproved in PHP 7.x and have been fully removed. These include:

The $php_errormsg variable
The create_function() function
The mbstring.func_overload ini directive
The real type
The allow_url_include ini directive
The restore_include_path() function
The each() function

Therefore, as a freelance web developer, any update to the programming language should be respectable.

Top comments (0)