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 on PHP 5.3.3 released!.
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?