While WordPress still supports PHP5, the PHP project continues to evolve. PHP 7.2 was recently released and while it is not a huge update like PHP 7.0 was, but there are some interesting new feature and there are some important deprecations you should be aware of.
In this article, I will share some important highlights of what is new, and what to look out for when you update your sites and code to PHP 7.2. If you’re still on PHP 5.6 or PHP 7.0, you will want to do so before the end of the year, when security support for both ends.
What is PHP?
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. Any website can use PHP, but WordPress was actually built with it, meaning every single WordPress site uses it.
I will share some important highlights of what is new, and what to look out for when you update your sites and code to PHP 7.2. If you’re still on PHP 5.6 or PHP 7.0, you will want to do so before the end of the year, when security support for both ends.
Why you should upgrade to PHP 7.2?
We’ve been hearing since PHP7 turned out about how much speedier it is than PHP5. PHP7 tends to run WordPress 200 percent – 500 percent times quicker than PHP5. We know moving far from PHP5 bodes well for execution reasons, it’s an easy decision, yet are there any changes in execution redesigning from a more established form of PHP7 to the most recent? Indeed, there are. Beginning tests on PHP 7.2 alpha demonstrated 18-22 percent enhancements in execution versus PHP 7.1.
Cryptography is not easy and is best left to specialists. Having a standard toolset should make it easier for us to do cryptography right. The PHP extension Libsodium has become that standard and is now being added to PHP itself. Having this as part of PHP has already led to increased scrutiny of the code, which is what you want with an encryption library, and will lead to more.
Deprecations To Be Aware Of
PHP 7.2 has deprecated a few functions. there are many functions but important changes are e function create_function() has been deprecated. This function is pretty useless in modern PHP. It does something similar to what a closure does, creates a function without a name that is limited in its use, but with a lot less power and increased security concerns. Using create_function() when you can use an anonymous function, which we’ve had since 2009, instead doesn’t make much sense.