PHP reached a new milestone 3 days ago. And as always it’s quite exciting news. Some of the new features are already outlined by Evert Pot’s post which you can find here. And all of this of course can be found on the wiki and in the change log.
I’ll just outline some of the new and exiting features, deprecated notices and removed functions.
Simplified password hashing API
$password The password string to hash
$algorithm The hashing algorithm to use of which two are available at the moment
PASSWORD_DEFAULT which uses bcrypt
PASSWORD_BCRYPT which uses blowfish
$options makes it possible to add a salt or set the cost for the hashing algorithm
Verify if a hash and password match. Return true if they do and false if they don’t
Get information about a valid hash created with password_hash(). The function returns an array with the use d algorithm and options
Check if the supplied hash was generated by the provided algorithm and options. This might come in handy when the hash needs to be updated
Support for constant array/string dereferencing
If you work with objects you might have worked with object dereferencing. This Is used to chain method calls. Or the so called fluent interfaces
Now the same is possible for arrays and strings
Class Name Resolution As Scalar Via “class” Keyword
An easy way to get the full class name
Support for using empty() on the result of function calls and other expressions
PHP Parse error: syntax error, unexpected T_FUNCTION in
PHP Fatal error: Can’t use function return value in write context in
Support for list in foreach
List has been added for foreach loops. Great for eliminating unused variables.
Zend Opcache extension and enable building it by default
My short post about Zend Optimizer+ in February this year. Kind of slipped my mind. And i was somehow under the impression APC would be integrated. But this of course has to be Zend Optimizer+. Finally an opcode cacher available be default. And configurable from php.ini
; Determines if Zend OPCache is enabled
; The OPcache shared memory storage size.
; The amount of memory for interned strings in Mbytes.
; Max files in OPCode cache, use a number between 200 and 100000.
; The maximum percentage of “wasted” memory until a restart is scheduled.
; Append current working dir to script name
How often a file should be validated
; Enables or disables file search in include_path optimization
; Drop all PHPDoc comments
array_column function which returns a column in a multidimensional array
Fetching a column from a multi-dimensional array is now possible with a single function call.
Or fetch status code indexed by id
The following (not so useful) functions have been removed from the core php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(), zend_logo_guid(). And support for the ancient operating systems Windows XP and 2003 has been dropped!
Install 5.5 on Ubuntu (experimental)
If you want to experience the new version first hand and you work on Ubuntu. You can add the experimental PPA and give it a shot.