PHP 5.3 Released 120
Sudheer writes "The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Some of the key new features include: namespaces, late static binding, closures, optional garbage collection for cyclic references, new extensions (like ext/phar, ext/intl and ext/fileinfo), over 140 bug fixes and much more."
features! (Score:2, Informative)
PHP now comes with more GOTO!
new features in php 5.3 (Score:2, Informative)
Re:new features in php 5.3 (Score:5, Informative)
You can also read the official release announcement instead of some random guy's blog.
http://php.net/releases/5_3_0.php [php.net]
Re:Nuisances (Score:4, Informative)
There's a huge codebase out there that's using PHP against MySQL, and using PHP's original ereg regex syntax instead of the Perl-wannabe stuff. What are they thinking, when they set out to break this?
Nothing is broken. Ereg is moved to the 'official' extension pack called PECL, which you can use for full backwards compatibility. At the same time the community has been warning not to use the ereg functions for the past at least 3-4 years, if not more, citing worse performance, worse featureset, and the possibility of PCRE replacing it at some point in the future.
Re:A serious question (Score:1, Informative)
It might be easier to think about them as anonymous functions than as lambdas / closures, though they're both.
They can fit anywhere that used to take a callback. For example, array_walk() and array_map() can be written in a much more sane way, without having to create an external function and refer to it by name.
Re:Hooray fileinfo is standard! (Score:2, Informative)
Assuming your argument-order frustration lies with the classic needle/haystack inconsistency throughout the string and array functions, the whole issue goes away if the PHP guys would simply evolve the string and array natives to be treated like objects:
in_array($needle, $haystack) -> $array->contains($needle)
strpos($haystack, $needle) -> $string->pos($needle)
etc.
Do that, and people will naturally migrate from the old inconsistent methods and move towards the more natural and consistent new methods without breaking anything.
If you really think it's worth breaking backwards compatibility, you could implement a friends suggestion - adding the PHP version number to the <?php wrapper: i.e. change to <?php6 ... ?>. Job done.