04 August 2010 ~ Comments Off

PHP 5.3.3 Backwards incompatible change

Methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn’t affect non-namespaced classes.

namespace Foo;
class Bar {
    public function Bar() {
        // treated as constructor in PHP 5.3.0-5.3.2
        // treated as regular method in PHP 5.3.3
    }
}

Update from PHP.net

Tags:

Comments are closed.