What is the future of PHP? Is it a dead programming language?
Let’s take a closer look at PHP and try to predict its future. We are currently living in a technological revolution, with new devices and inventions presented year after year. There is always a new product, a new feature, a new tool. Technological developments happen so often, especially in the realm of Information Technology, that when we hear of a programming language that is still relevant after more than 26 years we remain stunned. That language is no other than PHP: Hypertext Preprocessor.
PHP is a scripting language, meaning that on it there are lines of instructions written that will run one by one. It is especially suited to Web Development, mainly in powering dynamic websites, or websites that are constantly changing according to changes made by the user, like creating an account, reading and posting comments, logging in, etc.
One of the reasons for PHP’s popularity is its simplicity. According to data from 2019, approximately 75% of all webpages were powered by PHP that year, making it the most used server-side programming language.
Even with PHP’s popularity and history of success, there are other languages that are slowly closing on it. On forums dedicated to Web Development such as the ones on Stack Overflow, a kind of social media website for developers, there is talk about PHP slowly dying.
There is no eternal ruler, and it is no different in the world of programming, but PHP might have a long way ahead of it, or maybe it is time for it to make way to other alternatives.
The history of PHP
PHP originally stood for Personal Home Page. It was created in 1994 by Rasmus Lerdorf, a Danish-Canadian programmer who was looking for a way to track users who visited his online Resume. As it happens with great inventions, Lerdorf did not have in mind originally a groundbreaking tool that would change the way most website over the world work.
He created the scripts that would make PHP only as a tool that was not available at the moment, which he later released to the public so anyone could contribute to it, to build over it.
After being released it started gaining popularity, so much that the source code had to be rewritten from scratch many different times, changing a great part of its syntax through time in an effort to expand its capabilities. PHP would later evolve into PHP 2.
Then, in 1997, Zeev Suraski and Andi Gutmans started collaborating with Lerdorf when they tried using PHP for their business but noticed that it lacked some of the features they needed. That meant another rewriting of PHP 2 and the creation of PHP 3. That is also around the time when PHP changed from meaning Personal Home Page to Hypertext Preprocessor.
During the years 2000-2010 PHP 4, 5, and 6 were released, each with their improvements and their challenges. Then, during 2014 and 2015, their subsequent version, PHP 7, was released. Some people consider PHP 7 the revival of PHP, due to the great improvements over its predecessors.
Last November, in the year 2020 a PHP 8 version was released, showing the world that, against all odds, PHP will not go down without giving a fight.
PHP was created in the first half of the ’90s, just when the Internet was starting to experience a boom in commercial opportunities and mainstream traffic, but still a long way to where we are now. When PHP arrived, the standards for writing scripts and creating programs were quite different than todays.
This is in part because of the continuous evolution of software and Web Development, but also because the tools created then satisfied needs that developers had at the time. There was no way for them to prepare for what the Internet would become in the next decades.
That said, there is no surprise in finding that PHP has gotten cluttered over time. PHP does not provide a clear pathway for solving a specific problem, instead, it has grown in a way that there are many different solutions to a single problem. This could sound like an asset, and in some cases, it might even be useful to have different options for solving a problem, but in reality, it makes it easier to write bad code.
Basically, it gives the developer many paths to the same destination, but no clear instructions on how to get there. This could also happen in any language, but developers have spent hours discovering simple mistakes among clunky code, and that is one of the reasons it has not been used as much as before.
Due to PHP being an old programming language, it also happens that it does not follow the newest and best methodologies. When comparing it with its modern competition, it falls noticeably below concerning up-to-date practices.
Still, most developers do not write raw PHP, instead, they use frameworks (a tool that uses pre-written code to provide an application-specific software. It is kind of a huge library for PHP.) such as Laravel that allows using chunks of pre-made code someone else wrote, instead of writing code line by line, and this leads to a cleaner solution. But having a long history of bad coding, even useful frameworks do not always give PHP an advantage over its competitors.
Another issue with PHP and this could be considered more social than technical, is that, as peculiar as it sounds, it has received from the coding community some hating for the last couple of years. Some of it could be traced to the already mentioned fact that its structure provides complex solutions to what could sometimes be simple fixes. But it can also be due to the fact that nowadays many people enjoy following trends and mocking whatever the rest are mocking, sometimes without understanding completely the real cause of the jokes.
PHP has its flaws, but its hate is sometimes uncalled for. Anyway, where there are rumors, there is also some kind of truth, and the rumors among the developer community are that PHP is slowly dying.
Why PHP is still thriving
One of the reasons why PHP is still strongly relevant and used by so many websites is because of the Content Management Systems (CMS) that uses it. These are ways to create websites with little-to-non no knowledge of programming.
The most popular of these systems is WordPress. According to 2020 data, about 34% of all websites were originally created on WordPress. That is 77 million websites. Other CMS’s that have a certain percentage on the total Internet’s websites, although not at the height of WordPress, are Drupal with 3%, and Joomla with 2%.
These percentages might not look like a lot, but they mean millions of working websites. These are popular among website owners because they allow building decent-looking sites without spending much money on getting headaches with the code.
Still, even when a good part of websites uses PHP over CMS, there are also some Internet giants that use it to power their websites. Tumblr, Etsy, and Mailchimp are some of them. Even websites like Facebook and Wikipedia used PHP for a long time, a trend that, in the 2000s spread to many different websites.
Over time, and with the constant growth of Facebook, they worked on HHVM (HipHop Virtual Machine), an alternative for PHP, and eventually implemented it on their social network. Wikipedia followed their lead and started using HHVM in 2014. But still, the influence of PHP on those websites is notorious.
As it happens with old programming languages, PHP is a good way to get familiarized with how Web Development works, and that is another of its strengths. Even when its structure has become strangely complex, it still is a good tool to get work done over the Internet. That is why many developers have worked for years to help keep PHP relevant and useful, collaborating so that its newer versions prove to be a good asset for programming.
Evidence that PHP can still be considered a solution is the already mentioned versions PHP 7 and PHP 8. As it was said above, PHP 7 was a great improvement over its predecessors. With this version, both speed and memory usage have been upgraded, allowing for websites to load faster than traditional PHP.
Since the days where just hundreds of users visited a website are over and have been substituted by thousands or millions of daily visits, PHP 7 takes better care of handling those constant visits. And, concerning a technical perspective, Error Handling has improved, and new operators have been introduced. And so, PHP 8 arrived at the end of 2020, with Union types, a yet more improved Error Handling, and JIT, among other features, continuing PHP’s fight for survival.
PHP is still an essential part of server-side development, but there are other newer technologies that have become essential for developers:
• Go. This compiled programming language was built by Google in 2009. It is considered one of the simplest server-side languages, as well as a speedy one. One upside to Go is that it has a designated Integrated Development Environment (IDE) which makes the development process faster and better by providing all the functionality a developer needs when working with it.
• Python. It is now being used more than PHP in server-side development, also Python is extremely popular with beginners and professionals, due to its simple and powerful frameworks Django and Flask, as well as its easy-to-understand syntax.
Looking at the future
One thing about PHP is that, as it was mentioned in its qualities, is that it is still greatly used, even when it is considered a language in decay. That means that it is essential for developers to learn about it, since there are, and there will be for the perceivable future, thousands of jobs available for the skill. It is not something that will disappear soon, and that allows for people with PHP experience to diversify their skills, while also finding PHP useful and relevant.
The fact already stated that 75% of websites were powered by PHP in 2019 gives us an idea of where the Internet stands and the immediate future for users and developers.
On the other hand, when talking about Go, Google’s programming language, we are talking about a language created with cloud computing in mind. It is a language made precisely to the working programmer, with features such as enforced coding style, fast compile-time, static typing, and others because it maintains the idea that scalability is essential.
Even having started at Google it is an open-source language now, and everyone can collaborate. So Go, with its mind in the cloud, and the capability to scale could also be a leading technology in the future.
When talking about a great part of popular programming languages we hear about their simplicity, but Python is one that totally lands that claim. A lot of the world’s websites use Python in some frontend features or on their servers. Sites like Instagram, Spotify, Netflix, Uber, and many others rely on it for different things.
It has grown exponentially these last years, and with the help of its libraries mentioned above, it has everything it takes to remain a must-have for every website out there. It is interesting to think about what kind of future will Python bring to the Internet.
Back in 1994, when PHP was created, the Internet was a different place. Not even the greatest visionaries could predict all the changes that the World Wide Web would have. The direction that the Internet might take could look clearer now, but History has taught us that changes sometimes come unexpectedly. So no one knows what the future holds, especially concerning software, and specifically PHP.
Who would know if PHP will still be relevant in another 26 years, or if it will still be remembered? Maybe the programming languages we have today will be part of a History of programming class in the future. But for the time being, PHP is still alive and well. Let’s see what the next years bring.