PHP 5.3.0 released
Two and a half years after the release of PHP 5.2.0 and following a slight delay, the PHP development team have announced the release version 5.3.0 of PHP. Version 5.3.0 of the web programming language includes several fundamental new extensions, as well as a number of other new features and is the one of the biggest revisions in PHP's history. Many of the functions originally planned for PHP 6 have ended up in the 5.3 development pipeline.
One key new feature is namespaces, a long yearned-for, but controversial, language feature that allows the same name (for a constant, class or function) to be used in different namespaces without triggering a conflict. Version 5.3 also introduces a major feature of object-oriented programming – dynamic/late static bindings. This involves deciding which method will actually be executed for a method call at runtime. Previously late binding was only implemented for instance methods – binding for class methods was static. Programmers can now decide for themselves whether they wish to use dynamic or static binding when calling a class method.
Prior to PHP 5.3, the only way to declare a lambda function was with
create_function(). In PHP 5.3 it is possible to record an anonymous function directly in the source code. Thanks to this, the PHP interpreter is now able to discover any syntax errors in the body of the anonymous function during compilation. Another new feature is closures – anonymous functions with binding of external 'lexical' variables.
PHP has also gained a new garbage collector, which uses the algorithm described in the IBM paper Concurrent Cycle Collection in Reference Counted Systems. What's special about this is that it detects and triggers object cycles. The new garbage collector makes its presence felt in particular during long-running PHP processes. As well as improvements to the garbage collector, the PHP development team have made further modifications to the PHP interpreter affecting both execution speed and memory usage.
Finally, mysqlnd, an implementation of the MySQL client/server protocol developed and optimised for PHP, has also found its way into PHP 5.3. This achieves significant improvements to runtime behaviour when dealing with large volumes of data. Thanks to support from Microsoft, PHP 5.3 also narrows the functionality, performance and stability gap compared to other operating systems when running under Windows. Functions which were previously only available, or performed differently under Unix, can now be used on the Microsoft platform. Additionally, the release also includes over 140 bug fixes and several new extensions, such as ext/phar, ext/intl and ext/fileinfo.
More details about the 5.3.0 release can be found in the release announcement and the PHP 5 ChangeLog. PHP 5.3.0 is available to download. A migration guide is also provided for users upgrading from PHP 5.2 The PHP code is currently distributed under the PHP licence v3.01.