PHP and the Zend Framework
- “PHP Drives Web 2.0”
- —Andi Gutmans, AJAXWorld? Conference & Expo 2007 East.
On October 10 2006, Google purchased YouTube for $1.65 billion (BBC, 2006). The following month, Yahoo made a $1 billion dollar bid for social networking site Facebook (BBC (b), 2006). And just like that, the economics of web 2.0 applications suddenly seemed to be sweeping the haunting memories of the dot.com bust out of America’s corporate boardrooms. Perhaps it is not surprising that the leading minds at Zend Technologies have chosen this time to begin touting PHP as the driving force behind Web 2.0 (AJAXWorld? News, 2007). In this essay I will take a brief look at the reasons for the popularity PHP has enjoyed among developers, and the emerging Zend Framework that will make it possible to develop AJAX web applications in PHP. The purpose of the essay is to give the reader an general overview of where PHP development is going in the near future.
What is PHP and how does it work?
To start, PHP stands for Personal Home Page Tools. It is a general purpose scripting language that can be embedded into HTML to create dynamic web pages (PHP.net, 2007). PHP was created by Danish/Greenlandic programmer Rasmus Lerdorf in 1994 (Wikipedia, 2007). At the time, he was trying to find a simple way to display some dynamic content on his webpage, and to collect data on how much traffic his page was receiving (ibid). Lerdorf has stated that while there were other languages capable of helping him achieve his goals, such as Perl and Python, he wanted to create a set of tools that could automate common tasks he had encountered on different web development projects over a long period of time (Lerdorf, 2004). The early version of PHP was precisely that—a simple set of tools. One tool did some fancy hit logging to a database; another acted as a form data interpreter (ibid). When Lerdorf’s list of programs got too long, he combined all of them into a single C library (ibid). C is a general purpose programming language (Wikipedia, 2007). He then wrote a very simple parser that would pick tags out of HTML files and replace them with the output of the corresponding functions in the C library (Lerdorf, 2004 ). The simple parser slowly grew to include conditional tags, then loop tags, and functions (ibid). Lerdorf has said: ‘At no point did I think I was writing a scripting language. I was simply adding a little bit of functionality to the macro replacement parser.’ (ibid).
What began as a solo mission soon grew as other developers took interest in Lerdorf’s work and applied their skills to improve his parser and C library. Most notable among those are Zeev Suraski and Andi Gutmans, two Israeli developers at the Israel Institute of Technology who rewrote the parser in 1997 and formed the base of PHP 3 (Wikipedia, 2007). Suraski and Gutmans later founded Zend Technologies to sell packaged PHP products, programming tools and support (ibid). Lerdorf is now employed as an Infrastructure Architecture Engineer at Yahoo! Inc. (ibid)
Usage and Popularity
In February 2004, a Netcraft survey showed that PHP was installed on over 15 million domains on the web (Lerdorf, 2004). This was about 30 percent of the domains on the web at that time (ibid). By March 2007, that number had grown to over 20 million (PHP.net, 2007). From the looks of things though, PHP might be slowing down as the chart below shows:

(Courtesy of PHP.net, 2007)
Why is PHP so popular?
The reason for PHP’s popularity does not lie within its capabilities. Other competing languages such as Perl and Python are arguably more powerful environments. Indeed, Perl and PHP are often seen as competing languages because they both work well with servers (O’Reilly.net, 2004; MediaCollege?). Some of the participants on O’Reilly.net’s forums have argued that PHP has become more popular with new programmers because of the perception that it is slightly easier to learn than Perl from a web design point of view (ibid). This may have to do with the fact that PHP pages are constructed like HTML pages, with standard HTML markup (ibid). PHP code is inserted into the page using designated tags and executed when the page is requested (ibid). In contrast, Perl scripts are run as stand-alone programs and create HTML pages when the script is run (ibid). Another issue in the debate is over speed and efficiency. PHP is generally considered to be faster than Perl, although this is debatable (ibid). In the overall analysis, many programmers would agree that Perl is the more powerful language with the wider array of options (ibid).
Simplicity though is the key to PHP’s popularity. Lerdorf summed it up best as follows:
‘In the end, what I think set PHP apart in the early days, and still does today, is that it always tries to find the shortest path to solving the Web problem. It does not try to be a general-purpose scripting language and anybody who's looking to solve a Web problem will usually find a very direct solution through PHP. Many of the alternatives that claim to solve the Web problem are just too complex. When you need something up and working by Friday so you don't have to spend all weekend leafing through 800-page manuals, PHP starts to look pretty good.’ (Yank, 2002)
This simplicity has drawn large companies such as Yahoo! Inc. and major social networking site Facebook (AJAXWorld? News, 2007). Even the big players at IBM have taken notice and recognized that simplicity could enable PHP to overtake Java as a programming environment. "Simplicity is a huge part of it," said Rod Smith, vice-president of IBM's Emerging Internet Technologies Group, describing PHP's appeal to IBM in a meeting with reporters at the Zend/PHP conference in Burlingame, California in 2005. "They weren't interested in adding language features to compete with other languages," choosing instead "the simple way, and not the way we've done it in Java, unfortunately"(Shankland, 2005).
The future
In his seminal essay on Web 2.0 Tim O’Reilly pointed out that Asynchronous JavaScript? and XML (AJAX), a web development technique that incorporates a number of technologies to create interactive web application, was a key component of web 2.0 (O’Reilly, 2005). AJAX allows programmers to build web applications that are as rich in capability as desktop applications (ibid). It is this technique/collection of technologies that has been a major driving force in Web 2.0. It is true that PHP developers are looking to make the language a strong environment for the development of AJAX web applications.
Gutmans and his team at Zend are working on the Zend Framework, an open source project to create a framework for developing powerful and secure PHP 5 web applications (Zend, 2007). They believe that this framework will make PHP a successful backend for AJAX applications (AJAXWorld? News, 2007).
This is a development that is meant to address the rising popularity of Ruby on Rails—not quite the new kid on the block, but certainly the new star among the programming languages. While Ruby on Rails has been touted as powerful and simple, it is still has some shortcomings: its is hard to find a hosting package with Ruby and most programmers do not want to throw out their PHP work and start again from scratch. (Chase, 2006). With Ruby looming large in PHP’s review, Zend has developed the Zend Framework to incorporate the applauded functionality in Ruby, and to also include some more flexibility regarding Intellectual Property (ibid). Given these developments, if PHP is not yet a driving force in Web 2.0, Zend is certainly gearing up to make it a major player.
References:
AJAXWorld? News Desk. “PHP Drives Web 2.0," Says Zend's Andi Gutmans, "And PHP AJAX Projects Are Mushrooming” Retrieved on April 23 2007 from http://ajax.sys-con.com/read/351615.htm
BBC (a) 2006. Google buys YouTube for $1.65bn Retrieved on April 26, 2007 from http://news.bbc.co.uk/2/hi/business/6034577.stm
BBC (b) 2006. Yahoo 'to buy Facebook for $1bn' Retrieved on April 26, 2007 from http://news.bbc.co.uk/2/hi/business/5367120.stm
Chase, Nicholas. 2006. Understanding the Zend Framework, Part 1: The basics Retrieved on April 23 2007 from http://www-128.ibm.com/developerworks/opensource/library/os-php-zend1/
Kerner, Sean Michael. Is PHP The Cure For The 'Broken' Web?, internetnews.com, 2006-09-13. Rerived from Wikipedia, April 19, 2007 from http://en.wikipedia.org/wiki/Php
Lerdof, Rasmus. Do You PHP? 2004 (Retrieved on March 6, 2007) http://www.oracle.com/technology/pub/articles/php_experts/rasmus_php.html
Media College Perl Vs PHP. Retrieved on April 23 2007 from http://www.mediacollege.com/internet/perl/perl-vs-php.html
O’Reilly, Tim. 2005 What is Web 2.0. Retrieved on April 23, 2007 from http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html
O’Reilly OnLamp?.com Perl vs PHP 5 (2004) Retrieved on April 26, 2007 from http://www.oreillynet.com/onlamp/blog/2004/08/perl_versus_php_5.html
PHP.net (a) PHP: Hypertext Processor (Retrieved on March 6, 2007) http://www.php.net/
PHP.net (b) PHP: Usage stats (Retrieved on March 6, 2007) http://www.php.net/usage.php
Shankland, Stephen. 2005 Andreessen:The Future is PHP. CNet? News.com 20 October 2005. Retrieved on April 25 2007 from http://news.zdnet.co.uk/internet/0,1000000097,39232440,00.htm
Wikipedia (a): PHP Last Updated March 6, 2007 (Retrieved on March 6, 2007) http://en.wikipedia.org/wiki/PHP
Yank, Kevin. 2002. Interview - PHP's Creator, Rasmus Lerdorf. Retrieved on April 23 2007 from http://www.sitepoint.com/article/phps-creator-rasmus-lerdorf
Zend Technologies, 2007. Goals of the Zend Framework. Retrieved on April 26, 2007 from http://framework.zend.com/roadmap