X

PHP 5.5 adds new features for a developer’s delight

PHP is out with an update and it will bring a smile to the faces of developers longing for an update for a long time. PHP 5.5, the newly released version of server-side scripting language has come with addition that will make developer’s task a tad easier when it comes to coding. So what are these changes that will make developer’s love PHP even more? Let’s have a look at some of the additions made in the latest update of PHP 5.5.

1)      Generators

This feature in the updated PHP 5.5 will eliminate the need to write class that outfits the Iterator interface. It comes as a welcome feature that allows the coders to bypass writing boilerplate code that can save time and reduce the complexity of the code written. Generator does this by deriving functionality from yield keyword and instead of returning a single value it generates any number of values. This directly saves a lot of memory as the array size required to store all the values is considerably less.

foreach (range(0, 1000000) as $number) {

echo $number;
}

2)      Password hashing

PHP 5.5 has a new password hashing API function which eliminates the need for crypt() function that is quiet confusing at times. So this means that developers will be able to understand and implement secure hashing for the websites in a better way. In the new update instead of using crypt(), developer’s will use password hash() and password_verify() functions.

3)      Finally keyword

In this update finally keyword has been added which allows developers to mention the code to be run at the end of try and catch blocks. It is important because earlier developers were forced to repeat the code with both try and catch blocks.

PHP is a developer’s delight, it is a language that all developers around the globe love to work on. Simply because the language is easy and interesting. And integration of such new features adds considerably to the efficiency of the PHP developers.

 

Varun Sharma: Internet Marketing Analyst, present Director @kvrwebtech.com Since 2009. Providing Internet Marketing as a medium for all kind of businesses to achieve the modern era goals. Have been highly successful in cultivating projects in Real Estate, Financial and Education Sector.
Related Post