Posted on February 6th, 2016 by David Taplin
There was much talk of the anticipated PHP 7 release, and as of December 2015 it was officially in circulation, but what exactly does it bring to the table and what should we be expecting from it?
Well here are 5 reasons why you be excited!
1. Much Faster than Older Versions
PHP 7 is faster than any other version of PHP. Not just a bit faster, but much faster, in fact in nearly all cases on all platforms it’s twice as fast! With the help of the polished and reengineered ‘Zend Engine’, it his means that not only will you need fewer servers to handle the same amount of users but the code will be processed much faster than before.
2. Spring Clean
One of the main reasons for this new slicker, much faster version of PHP has come about due to it undergoing a good ‘spring clean’. The removal of many of the older unused functions as well as unsupported Server APIs & extensions have helped streamlined the code and allow for faster execution speed.
3. Better Memory Consumption
As already mentioned, PHP 7 is much faster than its predecessor PHP 5.6, the new streamlined version is 50% more efficient when it comes to memory usage.
4. Declarations & Hints
Another great benefit of using PHP 7 is that it will allow users to declare what kind of return type a function is expected, similar to argument Type Hints.
In addition, argument type hints and the new return-type declarations now support new scalar types, allowing developers to denote that they’re expecting strings, floats, ints or bools to be passed or returned.
5. New Null Coalescing & Spaceship Operators
PHP 7 introduces a new, aptly named, spaceship operator <=>, which has adopted the name as it looks similar to a TIE fighter. Ideal for combined comparisons when dealing with the likes of sorting. It’s also known as a three-way comparison operator and many other popular programming languages like Perl and Ruby already include it.
Incidentally if you were wondering where PHP 6 had gone? Well, in actual fact there was no PHP 6. There were several key motives for PHP 5.6 moving to directly to PHP 7 and missing out PHP 6, the main reason was due to the fact PHP 6 took so long to come to fruition, that both its reputation and usability was seriously tarnished leaving the core community reluctant to adopt it in anger. Then came along PHP 7.
If you have any queries or questions on our article then please get in touch with My Hosting Bubble.