The PHP development team is proud to announce the immediate availability of PHP 5.4.0. Sadly however – most servers and hosting companies out there are still running PHP 5.2.x – so while the release of PHP 5.4.0 comes as great news, many of you probably won’t experience it for another year or so. Before we get into that though, let’s take a look at some of the new things in PHP 5.4.0:
The key features of PHP 5.4.0 include:
- New language syntax including Traits, shortened array syntax and more
- Improved performance and reduced memory consumption
- Support for multibyte languages now available in all builds of PHP at the flip of a runtime switch
- Built-in webserver in CLI mode to simplify development workflows and testing
- Cleaner code base thanks to the removal of multiple deprecated language features
- Many more improvements and fixes
Changes that affect compatibility:
- Register globals, magic quotes and safe mode were removed
- The break/continue $var syntax was removed
- The ini option allow_call_time_pass_reference was removed
- The PHP default_charset is now “UTF-8” within the distributed php.ini files
Also take note that PHP 5.4 will be the last series to support Windows XP and Windows 2003. PHP will not provide binary packages for these Windows versions after PHP 5.4. For users upgrading from PHP 5.3 there is a migration guide available here, detailing the changes between PHP 5.3 and PHP 5.4.0.
Now, why is it that most people won’t get to experience PHP 5.4.0 for quiet some time? Well alot of it rests on the shoulders of web developers actually. See there are plenty of popular scripts out there which simply do not work in PHP 5.3. Sadly no-one has bothered to go ahead and update them. Many hosting companies have slowly started to roll out the support for PHP 5.3 while keeping PHP 5.2 as the default PHP install. Take HostGator for example, they offer support for PHP 5.3 by requiring you to setup a custom handler via .htaccess.
For a full list of changes in PHP 5.4.0, see the ChangeLog. Otherwise – go beg your host for support for PHP 5.4.0.