The upcoming release brings traits, a built-in web server and a short syntax for arrays

Nov 14, 2011 15:20 GMT  ·  By

PHP 5.4 is getting closer as the first release candidate has been made available. This late in the development process, no new features are being added, it's all about the bug fixing.

Still, if you've been itching to try your hand at some of the new things in the latest major version of the scripting language this is a good a time as any.

"The PHP development team is proud to announce the first release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours," the announcement said.

"This is the first release candidate. No new features will be included before the final version of PHP 5.4.0. The release candidate phase is intended as a period of bug fixing prior to the stable release," it added.

The last major release, PHP 5.3.0 came a couple of years ago, so the new version has been rather eagerly awaited by the ones needing the features PHP 5.4.0 adds.

Chief among the new additions are 'traits' a method of improving code reuse, a major goal of any object-oriented language, without adding too much complexity, for example, with multiple inheritance.

Traits enable developers to use the same code, for example a function, in multiple, unrelated classes.

Also new in PHP 5.4.0 is a built-in web server. The idea is to make it easier for developers to test and build their code on the machine they're running without having to install a full fledged web server on it who's only purpose would be to test the code as it's being created.

Finally, another addition is an alternative short syntax option for arrays. This simple change provides a different way of declaring an array, one that is more similar, identical in some cases to other web programming languages.

PHP 5.4 RC1 is available for download here.