Migrating from PHP 5.5.x to PHP 5.6.x

PHP 5.6.x is most commonly used PHP version and it comes tagged with some exclusive features and some backward incompatible changes for improvements.

 Constant Scalar expression

It facilitates to use  operations on constants or constant values

we can use it  in “Constant declarations”, “Class Constant Declarations”, “Class Property Declarations”, “Argument Declarations”, “Static Variable Declarations”.

 Example :

>/pre>  Exponentiation using the ** operator

The new ** operator allows to calculate a number to the power of another number.

 

 Variadic function with argument unpacking

In this …$numbers  receives the first argument as it is and the other into the $numbers array .

UTF-8

The default character encoding was set to UTF-8

 Zip Improved

ZipArchive::setPassword() function  which easily allows you to create password protected zip file.p

 POST memory requirement

Removed the functions always_populate_raw_post_data and $HTTP_RAW_POST_DATA  which reduced the usage of memory 2 to 3 times.

And getting POST   via ://input is unavailable when the form is multipart.

Large File Uploads

Php 5.6.x has no restriction on size of file to be uploaded. The previous limit was 2GB.

GMP operators now supports internal operator overloading

  • More expressive code.

  • It allows polymorphism for the functions performing arithmetic operations.

  • With operator overloading PHP 5.6.x can work with any type of numbers.

Importing  namespace function

It can be used with functions and constants.

Other features

  • json_decode is more strict in JSON syntax parsing

  • While defining array as a property of a class using array literal , keys won’t be overwritten

  • __debugInfo() method has been added

Even though, PHP5.6.x has many added features there are backward incompatibilities like lack of support for Windows XP and 2003.

Know More About This Topic from our Techies

Post By : Akshaya Moorthy (10 Posts)

"Akshaya Moorthy is a Software Engineer from Kerala with Bachelor’s Degrees in Computer Science. She has been working with Cubet for nearly a year and can handle technologies like PHP and Nodejs. She has always showed ardent interest in exploring new technologies and also strive for social service. She is an innovative thinker who also likes to write."


You might also like...

INDIA OFFICE

info@cubettech.com
+91 484 4054324
Skype : cubettech
Carnival infopark,
Unit IX-C, 9th floor PhaseIV,
Kochi, Kerala, India

LONDON OFFICE

info@cubettech.com
+44 2071938618
Skype : cubettech
Kemp House
160 City Road
London- EC1V2NX, UK.
Top