What's New In the Latest PHP Release?

PHPA few days ago, August 28, the PHP team of developers announced their new stable version of the most popular programming language, PHP 5.6.0, is available for the public. The version includes a number of freshly-built features, many improvements and certain backward incompatible changes.

The main feature the new PHP can boast are:

  • Constant scalar expressions.
  • Exponentiation through the ** operator.
  • Argument unpacking and variadic functions through the ... operator.
  • Importing of functions and constants through the use keyword.
  • php://input has been made reusable while $HTTP_RAW_POST_DATA has become deprecated.
  • phpdbg serves as the interactive integrated SAPI debugger.
  • GMP objects can now support the operator overloading.
  • Uploading files with the size of over 2 gigabytes is now accepted.

To look up the full list of the newly introduced features, read the chapter “New Features” in the migration guide.

As for new changes affecting compatibility, they include:

  • You don’t need to overwrite array keys when assigning an array for a class property via the literal array.
  • json_decode() now became more strict in terms of JSON syntax parsing.
  • GMP resources now became objects.
  • Mcrypt functions require valid keys and IVs now.
  • Stream wrappers has been made to verify peer certificates as well as host names while using SSL/TLS, by default.

If you need to upgrade your PHP version from 5.5, you can read the full migration guide which details all changes between the two releases.