“The open source PHP language is seeing its first major update in two years courtesy of today’s release of PHP 5.3, along with a long list of new features designed to expand its capabilities and accelerate performance. The PHP 5.3 release is a bigger release than developers first intended, and takes on some features that were originally intended for PHP 6. The new release also comes as the open source language continues to face competitive challenges from multiple technologies including Ruby, Java and .net.”
PHP 5.3 is a great update to the language, perhaps on par with the OOP improvements in PHP 5. Some of the most interesting new features:
– “Javascript-style” closures have been adopted, allowing for very elegant chaining of functionality. Closures will be usable everywhere in PHP’s core functions where a callback type is used.
– Late static binding adds the actually called class to the call information. This can make your static methods more powerful. For instance, define a single static findById($id) method on your record superclass, and when Invoice::findById() is called you know to query the “Invoice” table.
– Namespaces will prevent headaches in large projects. Yeah, the \ token as a namespace separator is weird. But when you look at nested namespaces like a Windows\Path\Name it’s not that foreign.
– The optional garbage collector will be very useful if you run PHP scripts as a daemon or for long batch jobs, an area where PHP was not so common and could use a boost.
– SPL provides for some convenient data structures like SplHeap, SplStack and SplQueue.
There are a lot more evolutionary changes, but these are some of the most interesting things. For the run-of-the-mill web script maker, not much will change. There aren’t too many backward compatibility breaks to be expected, so hopefully adoption at hosting providers will be strong. Though I look at this update more as a “6.0” in terms of new features, the seemingly minor version increase might quash fears about upgrading. In any case, when you have control over your PHP install, you can start taking advantage of the new features quickly.
Anyway, great work and the improvements demonstrate that PHP is still growing and using PHP for advanced web related work remains a viable strategy for the foreseeable future.