It is one of the widely used programming languages across the Web today, but PHP was created with decidedly modest ambitions, according to the creator of the language.
“PHP doesn’t really blaze a trail of innovation,” admitted Rasmus Lerdorf, who created and now helps maintain the Web programming language. Lerdorf talked about the past and the future of PHP at the O’Reilly Open Source Convention, being held this week in Portland, Oregon.
Lerdorf’s talk was a timely one, given the increasing rancor the language has seemingly provoked over the past few years. In an essay that was widely circulated on Twitter, developer Alex Munroe detailed a litany of what he felt were bad design decisions behind the language.
“Virtually every feature in PHP is broken somehow. The language, the framework, the ecosystem, are all just bad. And I can’t even point out any single damning thing, because the damage is so systemic,” Munroe wrote.
Others had also posted similar complaints. Even “New York” magazine — not exactly known for its technical acumen — has piled on, stating, “PHP is a programming language like scrapple is a meat.”
“I had no intention of writing a language. I didn’t have a clue how to write a language. I didn’t want to write a language,” Lerdorf said of PHP’s origins. “I just wanted to solve a problem of churning out Web applications very, very fast.”
Lerdorf wrote PHP in 1993 to handle simple interactive tasks such as one with the ability to query a user and generate a form based on the results. But at the time, “the amount of code you needed to write just wasn’t feasible,” Lerdorf said. He tried using Perl, but writing HTML code within a Perl program was difficult for him, given the syntax rules of Perl. So, he used Perl to build his own language. “This simple thing turned out to be what PHP is today,” he said.
From this humble start a powerhouse emerged. Lerdorf estimated that, today, PHP is behind about 50 percent of the mouse clicks on the Internet. “Pretty much every large Internet company [uses] PHP,” he states. He points out that Yahoo, Facebook, Zynga, and most all of the world’s blogs run on the language. It is almost universally used by Asia e-commerce and social media sites, as well as by many pornography sites.
PHP succeeded because it was uniquely suited to the emerging world of the Web, Lerdorf argued. “The focus wasn’t on the language itself, but on the ecosystem,” he said. It fit very well with the other components of the then-emerging Web, including what would soon become the world’s dominant Web server software, Apache HTTP Server.
PHP “is more about how easy it is for people to get started, without thinking too much about the technology,” Lerdorf said. “You can have the prettiest language in the world, but if it can’t talk to the back end, and you have no way to host it, it is useless.”
ISPs (Internet Service Providers), in particular, found the technology useful because it worked very well in shared environments. Each account on a server could use a single copy of PHP without having any effect on other users. Also, the language scaled very well, thanks to Lerdorf’s reluctance to complicate PHP with features, such as a database, that could be better supplied by external technologies. “PHP, on its own, scales infinitely. You never read about PHP scaling problems,” Lerdorf said.
After his reminiscences, Lerdorf also spoke of the latest release of the language, as well as future plans.
The most recent edition of PHP, version 5.4, released in May, comes with a number of improvements, he said. Memory management has been vastly improved. “We’ve seen a 50 percent reduction” of memory used in some large configurations, Lerdorf said. For busy environments, this means more copies of Web server software can be placed on a single machine. PHP 5.4 also features a built-in Web server, which could be really handy for debugging, especially given the sometimes opaque nature of PHP’s error reporting. With the PHP 5.4 server, you can run an instance of the WordPress blog from the command line.
One thing that did not make the 5.4 release was the full support for Unicode, the universal character set for all the world’s languages. Because PHP is used the world over, it makes sense to support all the globe’s languages out of the box. But the problem is that current Unicode libraries use far too much memory. “We’re looking for a good Unicode library. The current [International Components for Unicode] library is a monstrosity,” Lerdorf said.
Going forward, future editions of the PHP will be released more frequently, he said. “Instead of going three or four years between major releases, we are going to try to speed things up a bit. We will have smaller, quicker releases. Developers don’t have to wait five years to try a new feature.”
Version 5.5 of the language will be released by the end of this year or the early part of next year, Lerdorf said. This is a much shorter turn-around time than the nearly three-year lapse between PHP 5.3 and PHP 5.4, released in May.
Lerdorf also talked about the debugging process of PHP. The language’s developers rely on outside testers to ensure a new version of PHP works across all combinations of hardware and software. Reviewing and fixing can be an exhausting process, he explained. Thus far, users have reported more than 62,000 bugs in PHP, though more than 20,000 of them turned out not to be bugs at all, but rather due to faulty external configurations or user errors.
Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab’s e-mail address is Joab_Jackson@idg.com