php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

PHP 5.3.3 and 5.2.14 are out

Posted by on July 26, 2010

July 22 has seen the release of two new versions of PHP from the main development lines — the innovator 5.3.x and the previous 5.2.x. There are interesting news for these new releases, which are both stable ones.

PHP 5.3.3

This release contains one incompatible change, but note that this BC break is only relevant to namespaced classes. This makes PHP 5.3.3 slightly backward incompatible with previous PHP 5.3 versions at most, but fixing the issue now at the start of the adoption period of 5.3.x was probably the best solution.

Basically, methods named like the class are not considered constructors in namespaced classes:

<?php
namespace Bar;

class Foo
{
public function Foo() {} // not a constructor anymore
}

The previous behavior was causing problems, for example, with Zend Framework view helpers. These classes had an API method named as the base name of each helper class. With the migration to namespaces, the basename became the name of a constructor (which logically should have been the fully qualified name of the class; in the case above Bar/Foo, an illegal method name).

The fix is backward incompatible but clears the picture and targets only the __construct() method as the constructor for namespaced classes. Zend Framework 2 will probably stop using method named as so to favor a conventional name like direct(), but this change actually simplifies the porting of PHP 5 code to namespaces by removing a possible clash of method names with the constructor.

PHP 5.3.3 is also a maintenance release which corrects many bugs on memory corruption and buffer overflows. It also features the upgrade of the PCRE and sqlite extensions.

PHP 5.2.14

This release is a maintenance release for the old 5.2.x branch, which marks the end of the active support for this line of development.

This means bug fixing won’t be available for PHP 5.2 anymore, and only security fixes will be evaluated for inclusion from now on, on a case by case basis. PHP 5.2 is essentially being faded out for the adoption of the faster and powerful 5.3 version.

Personally I’m glad the process for upgrading from 5.2 to 5.3 has already been started, given the previous experience with PHP 4. PHP 4 end of life period was extended until it reached the final deadline of 8-8-8 (August 8th, 2008), and it is still around on some servers nowadays.

If you use PHP 5.2, there is a migration page to help transitioning your applications to PHP 5.3 which lists the few incompatible changes you’ll have to address. Most of old PHP code already works out of the box in PHP 5.3, and you’ll obtain helpful new features like namespaces and anonymous functions.


Marco is the keeper of keys and Chief Garbage Collector at Blue Parabola. He can be found on Twitter as @mtabini.

 

Responses and Pingbacks

Thank you for the update ;).

Im glad too that 5.2 wont be updated anymore. Its time to move on.

Tried a test upgrade to PHP 5.3.3 on a Windows/IIS platform. They changed the MySQL driver on the Windows executable and now it won’t talk to our MySQL servers, which use an older authentication method. Can’t upgrade the MySQL servers due to other constraints, and don’t have the resources or time to try to figure out how to recompile PHP for Windows and sub in the old driver. PHP 5.2.14 is end of life for us. 🙁

Leave a comment

Use the form below to leave a comment: