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.


namespace Foo {
    class Bar {
        function Bar() {
            // constructing \Foo\Bar class
        }
    }
}

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!

1 comment so far. Add yours.

  1. Happy 15th, PHP

    Today marks the 15th birthday* of PHP. I did have a nice, long post planned but lost it during the drafting process (maybe I should use WordPress which auto-saves?). So, in a new concise train of thought I’ll leave the rambling to other folks in the PHP community who will (hopefully) be providing their reflections over the last decade and a half. I’ll amend links to this post for those who don’t want to search around for birthday wishes.

    Happy birthday, PHP! :)

  2. Glob Patterns for File Matching in PHP

    This article has been on the cards for a while now with recent articles elsewhere1,2 prompting me to get this finished and up on the blog. The focus here is on the wildcard patterns that can be used with glob.

  3. PHP 5.3.2 Released

    Today, the latest version of PHP 5.3 has been released to the masses. The official announcement can found in the news archive with finer details in the changelog. Key points were outlined in the announcement, partially quoted below.

  4. Using PHP Functions in XPath Expressions

    Disclaimer: this article expects familiarity with using the DOM1 extension and XPath2 expressions.

    The (currently undocumentednow documented3) DOMXPath::registerPHPFunctions method is available as of PHP 5.3.0 (it was added to the code base back in December 2006) and allows the use of PHP functions (and static methods) within XPath queries to complement the normal set of XPath functions2.

  5. Comments on “Creating a Crypter Class with PHP”

    The following was supposed to be a comment to the Nettuts+ article published recently entitled Creating a Crypter Class with PHP. The powers that be over there seem not to want to moderate the comment so I’ll publish it here and hopefully the trackback will connect things together. The comment is after the fold and it would make sense to perhaps at least scan over Christian’s article before reading my comments.