PHP

What’s New in PHP 7.2: Literally Better Everything

As we all know, most web developers love and hate PHP with a passion. I’m one of those developers that absolutely love it. I know PHP like the back of my hand. Now, since 7.2 has been released, my love is growing even more! Let’s talk about the awesomeness that the newest version brings to us.

Security is the Most Important Thing Here

The 7.2 Release offers some highly needed improvements to security.

  1. The Libsodium cryptography library, for authenticated encryption and high-speed elliptic cryptography, is now a core extension. I’ve been waiting for this to happen for a while now.
  2. The Argon2 algorithm for hashing passwords addresses my personal downsides of the current algorithms, in that they were designed for the highest memory filling rate.
  3. Bye bye Mcrypt. The Mcrypt cryptography library extension has been officially removed. PHP’s developers have said that Mcrypt greatly inhibited the growth of the PHP language and served as “abandonware.”
  4. SSL/TLS (Secure Sockets Layer/Transport Layer Security) constants have been improved.

Improved Programming Language Features

There are other updates to help fix some people’s complaints about the language. So, here we go.

  1. A new warning has been added when calling the count () function with a parameter that is a scalar, a parameter that is null, or an object that does not implement the Countable interface.
  2. Object typehints fix a situation in which a developer can’t declare a function that needs to be passed an object as a parameter or declare that a function should return an object. The fix uses object as a parameter type and as a return type.
  3. HashContext as Object migrates the hash extension to use an object extension for hash contexts instead of using resources.
  4. Conversion of numeric keys in object/array casts addresses an issue with the Zend Engine, which powers PHP 7. The engine has cases in which array hash tables can contain numeric strings, while object hash tables can have integer keys. In such cases, PHP code can’t find the keys. With the fix in PHP 7.2, keys of arrays or object hash tables are converted as appropriate, so numeric string property names in objects become integer array keys and vice versa, solving the issue of inaccessible properties.
Published on Web Code Geeks with permission by Traven West, partner at our WCG program. See the original article here: What’s New in PHP 7.2: Literally Better Everything

Opinions expressed by Web Code Geeks contributors are their own.

Traven West

Traven is a security-minded programmer who loves to study psychology and philosophy also. He loves to chat about programming, cybersecurity, and the questions of life. He is the Lead Author of TheLastTechie and a freelance web developer in his free time.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
pardeep
6 years ago

Great! knowledge how to use new features.

Pardeep is a PHP Community Manager at Cloudways – A Managed PHP Hosting Platform. He love to work on Open source platform , Frameworks and working on new ideas.

Back to top button