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.
Started working as a digital marketing expert, Varun Sharma is now also a well-known digital marketing speaker – a speaker on performance development, and a trusted mentor to businesses in the digital world. His keynote expositions are based on the digital marketing theories, which provide a fascinating insight into the secrets of high performance.