A Brief Historical Introduction to PHP

Historical Introduction to PHP
A Brief Historical Introduction to PHP

PHP is one of the most popular programming languages used by web developers around the world. The recently released PHP version 7.x has made this language better and more stable than ever. According to w3techs.com, PHP is used by 79.0% of all the websites whose server-side programming language they know.

The PHP that we use today is quite different from its initial version. It is, therefore, useful and interesting to know about the historical evolution of PHP language. This brief history of PHP evolution might help you to understand the current state of PHP language functionality in a better way and the reasons behind this evolution. This article describes a brief history of PHP language evolution from being a simple set of CGI programs written in C language to a purely procedural language and then to its current state of a full-fledged Object Oriented language. This history of PHP language evolution would be much helpful for those who do not know what PHP is and how it was born.

What is PHP?:

PHP is an Open Source server-side scripting/programming language, which is widely used by web developers for creating dynamic and interactive web pages. Server-side scripting is used in web development, where scripts are executed on the web server, which then generates an HTML (HyperText Markup Language) response page customized for each user’s (client’s) request made to the website. There are a number of server-side scripting languages that can be used for developing web applications. Some popular examples of the server-side scripting language are- PHP, Python, Ruby, Perl, ASP, Java and Tcl etc. Out of these server-side scripting languages, PHP is one of the most popular languages used by web developers.

A Brief History of PHP:

PHP has come a long way since its inception and it is still evolving. A brief history of different versions of PHP is described below-

PHP 1.0:

PHP was initially written by Rasmus Lerdorf in 1994. The very first incarnation of PHP was a simple set of Common Gateway Interface (CGI) programs written in C programming language. He used it for tracking visits to his online resume and therefore named it as “Personal Home Page Tools (PHP Tools) version 1.0”. The syntax was similar to that of Perl including Perl-like variables (variable name preceded by a dollar ($) sign), form handling (automatic interpretation of form variables) and the ability to embed HTML (Hyper Text Markup Language). In June 1995, Rasmus released a complete rewrite of the source code of “PHP Tools” to the public to allow developers to use it and improve it. “PHP Tools version 1.0” can still be downloaded today from PHP Museum. As mentioned by Rasmus in his “PHP Tools version 1.0” release announcement, some of the functions that “PHP Tools” were able to perform were-

Key Features of PHP Tools 1.0:

  1. Accesses to your pages can be recorded in private log files.
  2. Viewing of this log information in real-time in a nice interface.
  3. Latest page access information can be displayed right on your pages.
  4. Full daily and total access counters.
  5. Domain based access ban for users.
  6. Password protected pages based on users’ domains.
  7. Tracking accesses based on users’ e-mail addresses.
  8. Tracking referring URL’s – HTTP_REFERER support.
  9. Ability to not log accesses from certain domains.
  10. Easily create and display forms.

PHP 2.0:

Because of performance reasons, the various small tools of “PHP Tools 1.0” had to be brought together and integrated into the web server. Fortunately, at that time, Apache web-server software was starting to gain momentum and the Apache API made it easier to add functionality like PHP to the server. Over time, more functionality was desired and therefore Rasmus rewrote “PHP Tools” to produce a much larger and richer implementation. The language was deliberately designed to resemble C in structure so that it can be easily adopted by developers familiar with C, Java, Perl and similar languages. This second-generation implementation began to truly evolve PHP from a suite of various small tools into a programming language in its own right. In November 1997, it was officially released as “Personal Home Page/Forms Interpreter or PHP/FI version 2.0”. As mentioned by Rasmus in his “PHP/FI version 2.0” release announcement, some of the functions that “PHP/FI version 2.0” was able to perform were-

Key Features of PHP/FI 2.0:

  1. Built-in support for logging every visit to your pages in either a DBM, mSQL or Postgres95 database.
  2. Built-in support for access restriction. Password protected pages or access restriction based on the referring URL plus many more options.
  3. Embed mSQL or Postgres95 queries right in your HTML source files.
  4. Built-in support for File Upload. Create file upload forms.
  5. Support for Variables, Arrays and Associative Arrays.
  6. Support for user-defined functions with static variables.
  7. Support for Conditionals and While loops.
  8. Support for powerful string manipulation through Regular Expressions (RegExp).
  9. Support for sending customized HTTP headers to the browser for advanced features such as cookies.
  10. Support for Dynamic GIF Image Creation by using Thomas Boutell’s GD Graphics Library.

It was most likely the fastest and simplest tool available for creating database-enabled dynamic websites (such as guestbooks) at that time. It was able to work with any UNIX-based web server. In 1997 and 1998, “PHP/FI version 2.0” had several thousand users around the world. A Netcraft survey in May 1998 indicated that nearly 60,000 domains were using PHP, which was approximately 1% of all domains on the internet at that time.

PHP 3.0:

Although “PHP/FI version 2.0” was having a large number of users, but it was still inefficient, lacking features and also there were some stability problems with the underlying PHP parsing engine. While there were a few contributors here and there, it was still primarily developed by an individual. At this point, Zeev Suraski and Andi Gutmans in Tel Aviv, Israel volunteered for a complete rewrite of the underlying PHP parsing engine in 1997 and formed the base of PHP 3.0. Rasmus, Zeev and Andi started to collaborate for the development of a new, independent programming language, which was officially released in June 1998 under a new name. It was renamed simply ‘PHP’, with the meaning becoming a recursive acronym – PHP: Hypertext Preprocessor. Some of the key features of PHP version 3.0 were-

Key Features of PHP 3.0:

  1. Support for all major operating systems (Windows 95/NT, most versions of Unix and Macintosh) and web servers (including Apache, Netscape servers, WebSite Pro and Microsoft Internet Information Server (IIS)).
  2. Support for a wide range of databases, including Oracle, Sybase, Solid, MySQL, mSQL and PostgreSQL as well as ODBC (Open Database Connection) data sources.
  3. Support for multiple protocols like SNMP and IMAP.
  4. Support for Object-Oriented Programming (OOP) was introduced.
  5. One of the biggest strengths was a new extension API for easily extending the language with new features. This attracted many developers to contribute to the PHP project.

PHP 3.0 provided a much more powerful, reliable and efficient implementation of the language while maintaining the ease of use and rapid development for a web developer. This was the key to PHP 3.0’s tremendous success.

PHP 4.0:

In an effort to improve the performance of complex applications, which were made possible by PHP 3.0’s new features, and to improve the modularity of PHP’s code base, Zeev and Andi started working on a new rewrite of PHP’s core. In 1999, they released a new PHP parsing engine which was named as “Zend Engine” (Zend is derived from Zeev and Andi). They also founded a company called Zend Technologies in Israel. Based on this “Zend Engine 1.0” and a wide range of additional new features, PHP 4.0 was officially released in May 2000. Some of the key features of PHP version 4.0 were-

Key Features of PHP 4.0:

  1. Because of “compile first, execute later” approach in “Zend Engine 1.0”, PHP 4.0 showed highly improved performance and reliability over PHP 3.0.
  2. The extension API was further improved for better run-time performance.
  3. Introduction of a web server abstraction layer allowed PHP 4.0 to run on all most popular web servers.
  4. Many new array functions were added.
  5. Support for HTTP sessions were added.
  6. Expanded Object-Oriented Programming (OOP) support.

Superglobals such as $_GET, $_POST, $_SESSION etc. were introduced in PHP 4.1.0. This feature was added to allow the register_globals option to be turned off. PHP 4.2.0 was released with the register_globals option turned off by default thereby closing possible security holes in applications. PHP 4.3.0 introduced the Command-Line Interface (CLI), where you can run a PHP script without using any web server or web browser. You only need the PHP parser to use it in this way. This is used in performing system tasks (such as CRON jobs on *nix or Linux, Task Scheduler on Windows etc.) in a scheduled manner.

PHP 5.0:

Since the Object-Oriented Programming (OOP) features in PHP 4.0 were very limited, therefore Zeev and Andi started working on a new object model of “Zend Engine” and released “Zend Engine 2.0”. Based on this “Zend Engine 2.0” and a wide range of additional new features, PHP 5.0 was officially released in July 2004. Some of the key features of PHP version 5.0 were-

Key Features of PHP 5.0:

  1. Highly improved and robust support for Object-Oriented Programming (OOP).
  2. The XML functionality was completely rewritten in PHP 5.0 using the libxml2 library. A new SimpleXML extension for easily accessing and manipulating XML as PHP objects.
  3. A brand new built-in SOAP extension for interoperability with Web Services.
  4. A new MySQL extension called MySQLi. This new extension included an Object-Oriented interface in addition to a traditional interface. It also supported many of MySQL’s new features, such as prepared statements.
  5. SQLite was bundled with PHP.

There were several minor and major releases of PHP 5.x branch. These releases include a large number of new features, bug fixes and security enhancements. Some of the key features of PHP 5.x series were-

Key Features of PHP 5.x Series:

  1. Simplified and improved Database handling with the PDO (PHP Data Objects) extension enabled by default.
  2. Input filtering extension was added and enabled by default.
  3. JSON extension was added and enabled by default.
  4. ZIP extension for creating and editing zip files was introduced.
  5. Hooks for tracking file upload progress were introduced.
  6. Introduced DateTime and DateTimeZone objects with methods to manipulate date/time information.
  7. Improved Object Oriented Programming (OOP) support with namespaces.
  8. Built-in webserver in CLI (Command-Line Interface) mode to simplify development workflows and testing.
  9. Added generators and co-routines.
  10. Added a simplified password hashing API.
  11. Significant performance improvements and reduced memory consumption.

PHP 6.0:

PHP was lacking native Unicode support. In 2005, a project was started to add native Unicode support throughout PHP. The plan was to embed the International Components for Unicode (ICU) library and represent text strings as UTF-16 internally. This would require major changes to the internals of the language and also to user code. So it was planned to be released as PHP version 6.0 along with many new features. Although significant progress was made in implementing Unicode support, but this project got delayed because of many reasons. As a result, PHP version 6.0 was officially abandoned in March 2010 and PHP version 5.3 was released with many non-Unicode features back-ported from PHP version 6.0.

PHP 7.0:

released. Some of the key features of PHP version 7.0 were-

Key Features of PHP 7.0:

  1. Significantly improved performance (PHP version 7.0 is up to twice as fast as PHP 5.6).
  2. .
  3. .
  4. .
  5. .
  6. .
  7. .

You can find release information about various PHP versions here.

History of PHP Books:

The very first book on PHP was published in April 1999. It was “PHP – tvorba interaktivnich internetovych aplikaci” (PHP – Creating Interactive Internet Applications) – a Czech book authored by Jirka Kosek. In the next month, a German book on PHP was also published authored by Egon Schmid, Christian Cartus and Richard Blume. The very first English book about PHP was published shortly afterwards and it was “Core PHP Programming” by Leon Atkinson. All these books covered PHP version 3.0.

While all above mentioned books were first of their kind, there were a large number of PHP books from a host of authors and publishers afterwards. At present there are more than 400 books in English, more than 100 books in German, more than 50 books in French or Spanish and few books in many other languages like Swedish, Korean, Japanese and Hebrew about PHP. The availability of a large number of PHP books by different authors, by many publishers and in so many languages is clearly a strong testimony for PHP’s world-wide success.