Uncovering the Fascinating Evolution of PHP: From Humble Beginnings to Dominating the Web
A brief history of PHP from 1995 to 2023
PHP was first introduced on June 8th, 1995, by the Danish-Canadian programmer Rasmus Lerdorf. Initially, the acronym stood for Personal Home Page. Originally, he saw it as a thin templating system on top of business logic written in C or a C API for the web.
The impact of early adoption
The world ignored the original vision and started forcing business logic into the templating system, which caused the foundation of PHP to pivot more towards this direction. As it grew in popularity, the original name didn’t make sense anymore so it was rebranded as PHP: Hypertext Preprocessor.
The community took hold of this new technology and played a major role in how it evolved throughout the years. This growth in adoption was beyond what Rasmus could have anticipated, and today the majority of the web is still driven by PHP, approximately 77.5%.
This unexpected adoption rate made it quite challenging for the contributors of PHP to introduce fundamental changes to correct earlier inconsistencies. After 25 years, Rasmus made the following statement at a presentation in Barcelona.
“Scaling up is expected. Scaling down (or simplifying) is surprisingly hard. Doing both is rocket science.” — Rasmus Lerdorf
The controversy
This legacy led to some expected controversy over the years, especially when comparing PHP to some of the more modern languages.
The following concepts introduced the most debates and controversy:
- Case-insensitive function names
- Naming inconsistencies
- The dollar ($) sign
- Globals
In PHP’s defense, Rasmus claims that the language is perfectly consistent, just not how you would expect. To his credit, he didn’t have the luxury of coming up with a new language interface and decided to stick as close to vertical alignment with dependent libraries, at the cost of losing some horizontal alignment.
It took me about 10 years to get used to the dollar sign. Even after mastering the subconscious training, I still find it challenging to switch back after developing in other languages like Python, GoLang, or JavaScript. The dollar was due to the influence Perl played in the early stages of PHP.
However, to my surprise, some developers do actually like the dollar sign. But I guess they also use tabs instead of spaces.
Highlights
After publishing this article, I received quite a bit of constructive criticism for not elaborating enough about the rich history of PHP. This proves the value of having such a strong and active community. The highlights below were inspired by the PHP community on Reddit.
The original syntax
PHP was not intended to become a new programming language, it just grew organically into one. Lerdorf said later: “I don’t know how to stop it, there was never any intent to write a programming language. I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way”.
The popularity and demand from the community helped shape it into what we have today.
<!--include /text/header.html-->
<!--getenv HTTP_USER_AGENT-->
<!--if substr $exec_result Mozilla-->
Hey, you are using Netscape!<p>
<!--endif-->
<!--sql database select * from table where user='$username'-->
<!--ifless $numentries 1-->
Sorry, that record does not exist<p>
<!--endif exit-->
Welcome <!--$user-->!<p>
You have <!--$index:0--> credits left in your account.<p>
<!--include /text/footer.html-->
The mascot
Vincent Pontier, a Danish artist, designed the ElePHPant in 1998. The community adopted it as the official mascot and was apparently chosen because it represents qualities such as strength, flexibility, and friendliness, which are also valued in the PHP programming language. Since then, the elephant has become an iconic symbol of PHP and is recognised worldwide as a symbol of the language.
Version 3 — The rewrite
There were so many changes from version 2 to 3 that most scripts required a complete rewrite. Some teams decided to run both versions in parallel and had to differentiate the scripts by naming the newer ones with a “.php3” extension.
Version 3 was a complete rewrite by Zeev Suraski and Andi Gutmans. A year later, they founded the company Zend (Zeev and Andi) which become a pivotal player in the PHP community.
Version 5 — The increased release cycle
PHP increased its release cycle starting with version 5.0, which was released in 2004. Before that, major releases of PHP were released at irregular intervals, with several years often passing between major releases.
With the release of PHP 5.0, the PHP development team established a more regular release cycle, aiming to release a new major version of PHP every 2–3 years. This allowed them to deliver new features and improvements to users more quickly and consistently.
In addition to major releases, PHP also has a regular schedule for minor releases, which typically include bug fixes and security updates. Minor releases are usually made every 1–2 months for the current supported major versions of PHP.
Version 6 — The one that never happened
Version 6 was set to be another major release and included exciting new features, including native UTF8/Unicode support. During development, some technical challenges delayed the much-anticipated version. While the Unicode experiments had never been released, several articles and book titles referenced the PHP 6 names, which might have caused confusion if a new release were to reuse the name. After a vote, the community decided to skip this version.
This was quite a shaky period for PHP, with a looming feeling of failure. To deliver on some of the promises, the team decided to back-port some of the features to version 5. These included: Improved Unicode support, namespaces, improved performance and error handling.
Version 7 — The boost
Version 7 introduced significant performance improvements and new features such as scalar type declarations and anonymous classes. The new version of PHP also included improvements to error handling and security.
PHP 7 is faster and more efficient than previous versions, making it an ideal choice for high-performance web applications. It also includes several new features that make it easier for developers to write clean, maintainable code.
Version 8 — Just-in-timeberlake
PHP 8 was released in 2020 with major improvements including just-in-time (JIT) compilation, union types, and attributes. JIT compilation allows PHP code to be compiled at runtime, resulting in significant performance improvements. Union types allow for more flexibility in function parameters and return types, while attributes provide a more streamlined way to add metadata to classes and functions.
PHP 8 also includes several other new features and improvements such as match expressions, named arguments, and constructor property promotion. These new features make PHP 8 one of the most powerful and versatile versions of PHP yet.
Release history
Let’s take a look at the major releases since the original release in 1995.
- PHP 1.0 (1995): The first version of PHP was released, providing basic functionality for web development.
- PHP 2.0 (1997): The second version of PHP introduced support for dynamic web pages and database connectivity.
- PHP 3.0 (1998): Support for object-oriented programming, which greatly enhanced the language’s capabilities.
- PHP 4.0 (2000): Introduced several new features, including support for XML, improved database connectivity, and the ability to create web services.
- PHP 5.0 (2004): A major release introducing improved support for object-oriented programming, including new features such as exceptions, interfaces, and abstract classes.
- PHP 5.3 (2009): Some new features, including namespaces, late static binding, and improved garbage collection.
- PHP 5.4 (2012): Traits, short array syntax, and a built-in web server for development purposes.
- PHP 5.5 (2013): Generators, a new password hashing API, and support for finally blocks in try-catch statements.
- PHP 5.6 (2014): Variadic functions, constant scalar expressions, and improved handling of empty().
- PHP 7.0 (2015): Significant performance improvements, as well as new features such as scalar type declarations, return type declarations, and the spaceship operator.
- PHP 7.1 (2016): Support for nullable types, class constant visibility, and the ability to catch multiple exceptions at once.
- PHP 7.2 (2017): Improved handling of negative string offsets, support for trailing commas in function calls, and the ability to convert numeric strings to numbers more easily.
- PHP 7.3 (2018): PHP 7.3 introduced support for flexible heredoc and nowdoc syntax, improved error messages, and better performance for JSON decoding.
- PHP 7.4 (2019): New features such as typed properties, arrow functions, and improvements to the garbage collector.
- PHP 8.0 (2020): JIT compiler, union types, named arguments, and constructor property promotion.
- PHP 8.1 (2021): Enums, read-only properties, first-class callable syntax, fibers, intersection types, and performance improvements.
- PHP 8.2 (2022): Many new features, including read-only classes, null, false, and true as stand-alone types, deprecated dynamic properties, and performance improvements.
- PHP 8.3 (2023 — pending): The following features are expected with this upcoming release. Improved error handling, new methods in the Randomizer class, fetch class constants dynamically, and improved Date/Time Exceptions.
Over the past 30 years, PHP has evolved from a simple set of CGI scripts to one of the most widely used programming languages for web development. With each major release, it has become more powerful, versatile, and efficient.
Today, it is used by millions of developers around the world to create dynamic, interactive websites and web applications. And with the release of PHP 8, it’s clear that PHP will continue to be at the forefront of web development for many years to come.
I will always be a fan of PHP, as it played a pivotal role in the interactive web as we know it today. At its time it was miles ahead of the rest and it played a fundamental role in inspiring the design of more modern technologies.
The contributors and community of PHP are still strong and won’t be going anywhere soon. However, the talent pool is starving and it is becoming increasingly challenging to find skilled candidates that still keep up with the trend. I guess, this is the natural progression of any technology.
To call on the popular folk song “Cotton-Eyed Joe”, hopefully, you now know a bit more about where PHP came from, but where will it go?