With the pending release of PHP version 5.4, due early next year, the creators behind the popular web scripting language are including the best parts of the now-abandoned PHP 6.0 project.
Last week, the team posted the second release candidate of PHP 5.4. They plan to release the completed version by early 2012.
With PHP 6.0, the development team's goal was to completely rewrite the language using Unicode, rather than ASCII. Unicode is a computer character set that incorporates the alphabets from most of the world's languages. Previous versions of the language rely on ASCII, which encodes only the English alphabet.
"I guess you could say it was too ambitious," said Zeev Suraski, one of the principal contributors to PHP as well as the chief technology officer and co-founder of PHP software vendor Zend Technologies.
Lack of success
At first glance, the idea to move to Unicode makes sense for PHP. It is the most widely used server-side scripting language around the world, according to an ongoing survey from Q-Success's W3Techs.
Rasmus Lerdorf created PHP in 1995 to help creating dynamic web pages by providing basic programming concepts to augment the static markup offered by HTML. PHP is an abbreviation of PHP: Hypertext Preprocessor, a recursive algorithm.
Building a Unicode-based PHP, however, developers found their implementation required twice the runtime memory. Perhaps this is not surprising, given that many of the characters in Unicode require multiple bytes to render. As a result, the software, though operational, was "significantly slower," Suraski said.
While the use of more memory may not be a big deal for a server running a single website, many of PHP's users run large sites requiring multiple servers operating at full capacity. "When you have a popular website, it's all about density: how many requests per second can your server take?" Suraski said. For these users, a greater memory requirement would translate directly into the need to buy more servers.
Because of this excess memory usage, the developers have temporarily halted work on the PHP 6.0 project, focusing their efforts instead on PHP 5.4 instead.
PHP 5.4 upgrade
But while PHP 6.0 has been shelved, some of its improvements have been rolled into the next routine upgrade of the language, PHP 5.4.
For instance, the issue that drove the idea behind full Unicode support, that of natively using more languages, has been addressed. PHP 5.4 has "inline support" for a number of new languages, including Japanese and some dialects of Chinese, Suraski said.
In prior versions of PHP, users that wanted a specific language, such as Japanese, would have to compile a version of PHP with the desired language, which forked these implementations from the standard PHP base. Now the installer only has to change a configuration setting, which would convert the base to Unicode for the desired language. Unicode isn't activated unless specified by the system administrator.
PHP 5.4 also includes a number of other changes that were originally slated for PHP 6.
One new project is called Traits, which will allow a developer to use a specific piece of functionality in multiple parts of an application. "In each class where you wanted to support logging, you could just use the logging Trait," Suraski said. Suraski likened Traits to Java's Multiple Inheritance.
Also, many of the features that have been deprecated from PHP and were set to be removed in version 6.0 are now being removed in 5.4 instead. One example of this is PHP's Safe Mode, a mode of operation designed for running PHP in multisite implementations. Safe Mode has been both notoriously buggy and gave users a "false sense of security," Suraski said.
Around 500 people contribute to PHP, Suraski said. About a dozen people contribute to the core PHP engine, and dozens of others maintain specific extensions, and over 100 people work on the documentation. Several months ago, the PHP maintainers changed the way the approval process of how new features get added, a process that would allow other maintainers to vote on whether new features get added.