What’s New in PHP 7.2: Literally Better Everything

elephpantblue

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.
Advertisements


Categories: Programming, Security

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: