Developers across the globe were delighted to welcome the new PHP 8 release in late November 2020. And now, the Magento community has begun its mission to make the Magento 2 PHP 8 compatible with the launch of the Magento PHP 8 Compatibility Community Project.
What does this mean?
PHP 8 is designed to bring a whole host of exciting features that make writing code more elegant. Most notably it brings some outstanding performance improvements, too. By making Magento 2 PHP 8 compatible, it allows Magento developers to benefit from these exciting enhancements. Through the community project, developers across the globe will work together to get everything up and running. In sort, Magento will soon benefit from some great developments that will underpin even better website performance.
Let’s take a closer look at some of the key technical PHP 8 features.
A key feature of PHP 8 is the new the increased performance that it brings with it. Through a combination of new features and added enhancements, there’s a notable impact on performance.
Just In Time (JIT) Compiler
One of the most popular and talked about features is the Just In Timer (or JIT) Compiler. This is a technique used to enhance the speed of scripts through the way it handles compilation. It’s no doubt that with this feature PHP scripts will benefit from faster code execution.
This powerful feature simplifies switch statements and returns values without the need for break statements. It’s also able to combine conditions and use strict type comparisons.
JSON support was previously an optional module but it’s now become a core part of the PHP 8 language ensuring it’s always available.
The addition of named arguments means it no longer matters what order you pass arguments as their name determines the parameter rather than their exact order.
And finally, something that will be great news for a lot of developers – you can now leave the trailing comma off at the end of parameter lists!
The launch of the PHP compatibility community project will bring new powers to Magento 2 through introducing these exciting features. At Aware Digital we’re looking forward to being part of the project as it develops and following its success.
If you’d like to get want to learn more or get involved, speak to one of our experts today.