New features in PHP 5.5

In this article we are discussing about the new features in the PHP 5.5. The PHP 5.5 comes with many new features which provides benefits to the web developers.

New features in PHP 5.5 - The latest version of PHP version 5.5 provides many
news features for the development of application in PHP framework

The PHP 5.5 is the latest release of PHP framework which comes with many new
enhancement and features. There are many new exiting features which is added to
the PHP 5.5 framework. In this tutorial we will discuss the new functionality
added and understand the benefits of these features for the development of web
applications.

Here are the important features of PHP 5.5

1. Generators

Now Generators are available in PHP. The Generators are used to iterate
through data without writing a class to Iterator interface.

2. The "finally" keyword is added in PHP

Now you can use the finally keyword while catching the exception in PHP.

try{

//Some logic

}catch(Exception $e){

//Do something

}finally {
echo "Final block";
}

3. The new password hashing API is now available in PHP 5.5

Here is the syntax of using the the password hashing API:

$hash = password_hash($password, PASSWORD_DEFAULT);

and you can can match the password using following code:

password_verify($password, $hash);

4. In PHP 5.5 Array and string literal deferencing added

In this version of PHP both array and string literals can now be dereferenced
directly. It allows to access individual elements and characters.

5. In PHP 5.5 you can easily resolve the class names

6. Now Empty() function can be used to accept the
expressions

Example:

if (empty(true)) {
echo "Its true";
}

7. Now PHP 5.5 provides support for the Zend Optimiser+ opcode.
Which provides great performance enhancements.