PHP 5.3.3 released!

Today, the latest version of PHP 5.3 (as well as the latest in the 5.2 branch, 5.2.14) has been released to the masses. The official announcement can found in the news archive with finer details in the changelog. A select few of the changes, of particular interest to me, are outlined below.

  • Added support for copy to/from array/file for pdo_pgsql extension. (Denis Gasparin, Ilia)
  • Changed namespaced classes so that the ctor can only be named __construct now. (Stas)
  • Fixed bug #51590 (JSON_ERROR_UTF8 is undefined). (Felipe)
  • Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus)
  • Fixed bug #48361 (SplFileInfo::getPathInfo should return the parent dir). (Etienne)
  • And well over a hundred other bug and security fixes

The change to constructors in namespaced classes has already been the subject of “why doesn’t this work” questions. With 5.3.3 you cannot define class constructors like below.

<code lang="php">
namespace Foo {
    class Bar {
        function Bar() {
            // constructing \Foo\Bar class
        }
    }
}
</code>

Instead, you need to be using the right and proper __construct method. Note that this only applies to namespaced classes, so old code can continue (if they like) using the class-name-based constructor. This really only affects the (few?) folks who might be making use of, or adapting their old code to use, namespaces yet still keeping the old style of naming the constructor method.

Go, play!

Previous
Next

3 Comments on PHP 5.3.3 released!.

Add your two pennies, others have already donated theirs.

  1. Michelle
    Jul 22 2010 at 22:10 BST

    I vote this to be second worst decision after introducing goto. What were they thinking? A backward incompatible change of such extend in minor version?

  2. ReallyPOUser
    ReallyPOUser
    Oct 11 2010 at 19:06 BST

    Yes. I can’t believe that such a major incompatible change was made in a minor-minor release and without any warning.

    I am stuck now because an existing application requires the old behavior and I only discovered this problem after updating to the latest 5.0.3 version of Zend Server CE which has PHP 5.3.3. I cannot find a way to download the older version of Zend Server 5.0.2 so that I can get this application working again. Btw, does anyone know where I can find the 5.0.2 version of Zend Server CE?

    I’m new to PHP and I’m *not* impressed with decisions like this as well as the absence of basic *built-in* debugging support. I’ve tried so far unsuccessfully to get Xdebug to work with Eclipse Helios & the PHP.NET version of PHP for Windows.

    Seriously, guys, this is 2010!

  3. Peter
    Oct 11 2010 at 19:53 BST

    ReallyPOUser, I can only ask that you contact Zend directly about obtaining the previous version of their product.

    As for not having debugging support built-in to PHP, and not being able to get Xdebug up and running, feel free to make such a feature request [1] and find support [2] respectively.

    [1] http://bugs.php.net/report.php
    [2] http://xdebug.org/support.php

Post Comment