While PHP6 might be nowhere in sight, a major update to PHP 5 has come with the recent release of PHP 5.4. This release comes nearly three years after the preview major update PHP 5.3.
Those familiar with PHP will know that there are major concern regarding the direction PHP should take in with PHP 6, such that its development has been indefinitely delayed. Instead, some of the features that would eventually have been released in PHP 6 are now being added to PHP 5 itself. Numerous such features were added in PHP 5.3, and more such features have been added in 5.4.
As with PHP 5.3, this release too breaks backwards compatibility in a number of ways. For example, Magic quotes, which had been depreciated in 5.3 has now been completely removed. Similarly, register_globals, and the PHP Safe mode have been removed after having been depreciated in the previous version.
A number of new features have also been added:
- The PHP CLI mode now has an inbuilt server for use while developing websites.
- PHP can track the upload progress of files so this information can be returned to the client for rich upload progress displays
- Traits; these are new major feature in PHP 5.4 that allow better code reuse. They are pretty similar to classes, however they can not by themselves be instantiated. A trait can instead be used to group together related feuntions and variables, and the trait can then be included in multiple classes to give them that functionality.
A number of other new features come with PHP 5.4; you can read about them here.