PHP5.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.

    <?php
    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
    }
    }
    ?>

  • There is no impact on migration from 5.2.x because namespaces were only introduced in PHP 5.3.

5.3.3里的命名空间,类的同名函数不再是构造函数,而是一般函数了。这个修改在5.3。0~5.3.2里是没有的。

5.2.x不受影响~因为命名空间是5.3才有的特性。

你可能感兴趣的:(php5)