See how PHP 5 compares to PHP 4 in this brief introduction to the language and learn what features have led PHP to be installed on over 15 million domains. (From the book, Beginning PHP 5 and MySQL: From Novice to Professional, by W. Jason Gilmore, ISBN: 1893115518, Apress, 2004.)
This chapter serves to better acquaint you with the basics of PHP, offering insight into its roots, popularity, and users. This information sets the stage for a discussion of PHP’s feature set, including the new features in PHP 5. By the conclusion of this chapter, you’ll learn how a Canadian developer’s Web page hit counter spawned one of the world’s most popular scripting languages; what PHP’s developers have done to once again reinvent the language, making version 5 the best yet released; and which features of PHP continue to attract new programmers.
The origins of PHP date back to 1995, when an independent software development contractor named Rasmus Lerdorf developed a Perl/CGI script that enabled him to know how many visitors were reading his online résumé. His script performed two tasks: logging visitor information, and displaying the count of visitors to the Web page. Because the Web as we know it today was still young at that time, tools such as these were nonexistent, and they prompted e-mails inquiring about Lerdorf’s scripts. Lerdorf thus began giving away his toolset, dubbed Personal Home Page (PHP).
The clamor for the PHP toolset prompted Lerdorf to begin developing additions to PHP, one of which converted data entered in an HTML form into symbolic variables that allowed users to export them to other systems. To accomplish this, he opted to continue development in C code rather than Perl. Ongoing additions to the PHP toolset culminated in November 1997 with the release of PHP 2.0, or Personal Home Page — Form Interpreter (PHP-FI). As a result of PHP’s rising popularity, the 2.0 release was accompanied by a number of enhancements and improvements from programmers worldwide.
The new PHP release was extremely popular, and a core team of developers soon joined Lerdorf. They kept the original concept of incorporating code directly alongside HTML and rewrote the parsing engine, giving birth to PHP 3.0. By the June 1998 release of version 3.0, over 50,000 users were using PHP to enhance their Web pages.
NOTE 1997 also saw the change of the words underlying the PHP abbreviation from Personal Home Page to Hypertext Preprocessor.
Development continued at a hectic pace over the next two years, with hundreds of functions being added and the user count growing in leaps and bounds. At the beginning of 1999, Netcraft (http://www.netcraft.com/) reported a conservative estimate of a user base surpassing 1,000,000, making PHP one of the most popular scripting languages in the world. Its popularity surpassed even the greatest expectations of the developers, as it soon became apparent that users intended to use PHP to power far larger applications than was originally anticipated. Two core developers, Zeev Suraski and Andi Gutmans, took the initiative to spearhead a complete rethinking of the way PHP operated, culminating in a rewriting of the PHP parser, dubbed the Zend scripting engine. The result of this work was seen in the release of PHP 4.
NOTE In addition to leading development of the Zend engine, and playing a major role in steering the overall development of the PHP language, Zend Technologies Ltd. (http://www.zend.com/), based in Israel, offers a host of tools for developing and deploying PHP. These include the Zend Development Studio, Zend Encoder, and the Zend Optimizer, among others. Check out the Zend Web site for more information.
This is from Beginning PHP 5 and MySQL: From Novice to Professional, by W. Jason Gilmore. (Apress, 2004, ISBN: 1893115518). Check it out at your favorite bookstore today. Buy this book now.