PHP “dying” this Decade: One Year After

What holds tomorrow’s technology for an old language is not up to date?

Italo Baeza Cabrera
The Startup
12 min readDec 30, 2020

--

Almost exactly one year ago I published an article that titled itself “PHP could fade away in the next decade”. The summary of the article I published is like a A Christmas Carol, but instead of Ebenezer Scrooge, it’s PHP:

  • In the past, PHP didn’t fix its problems, so other languages gained traction.
  • In the present, PHP lacks features needed for the Internet of today.
  • In the future, PHP still won’t have meaningful features.

Note that I never wrote “dying”, “don’t use it”, or even “ditch your PHP project now!”. I just said it would stop being relevant anytime before 2030, with a simple reasoning on why this would happen.

Articles that point out the bad things about PHP, considering its large user base, tend to trigger fanboys who think the language is perfect just because it’s convenient, or because they’ve spent more than 10 years using it, and mine is no exception. Anyway, I decided to pull it out from the cloud of negativity and give it more thought.

It’s not about me, it’s about you

Let’s start saying I have no personal vendetta against PHP, or any language at all. I consider it a very mature tool, and it’s my favorite thing to use when I need something “for yesterday” because it’s very convenient as an interpreted language and the ecosystem is there.

It’s also not about the code quality either. You can’t blame a language, at least no entirely, for a developer not using it “properly”. Doesn’t matter how fancy is your Ford or Lamborghini: if you don’t care about it, the maintenance will be painful.

Photo by Olga Kravchuk on Unsplash

It’s also not about how much people use PHP in the world. If we’re going the “it has a highest user base” route, then start migrating now your code to Javascript. That match is easily won by them, hands down, no contest.

Don’t get me started on “Is used by important companies” — more on that later. JavaScript is already mission critical for SpaceX, so clearly it’s not a bad language when the life of astronauts are at risk.

It’s just that PHP has become something like a one trick pony nowadays. The languages is known for thriving web development, but is shy to take further steps, officially. Other languages have been doing that instead. That’s a recipe for death.

Do languages “die”?

Let’s make a point with one of the old programming languages, COBOL.

Many decades ago, some of the old financing systems, those behind banks and insurance companies, were programmed using COBOL. Many financial institutions around the world still use COBOL in their mainframes, mostly due to one main reason: it still works. Proof of that was the sudden rise of COBOL hiring due to the pandemic to maintain these ancient systems that were hammered from everywhere, constantly.

COBOL is not dead, but what it means to be? There are tools to make COBOL-based software compatible with what the people needs today, like web pages, even if that means duct taping a rocket to a brick with a yielder. There is still people needed to write and maintain COBOL. There are even companies that offer some kind of support for COBOL based systems.

We can safely come to the conclusion that programming languages are impossible to kill. There is always one bastard using it to make money, and another bastard offering third-party support to make more money. It’s a win-win scenario.

In the corporate culture, if your technology stack is not “losing” the company any money, then it’s fine. Otherwise, you get something like Amazon ditching Oracle for their own AWS databases.

If it’s not dead, then what is to “fade away”?

COBOL is not dead, it has “faded away”: no one in their right mind would start a new project using COBOL, because there are substantially better tools. Tools that may have higher performance, better reliability, more programming convenience, or useful features. In the times of COBOL, there was no HTTP protocol, multi-threading, and virtualization, among other useful technologies that today software do use.

When people no longer uses a language for new projects, the domino pieces start to fall. Tools for that language stop being born and maintained. Since there is no demand, the language ceases to introduce new features, the community stops creating new toolsets, and it no longer spreads into other ecosystems — like how Node.js appeared in servers. There are no new programmers learning the language, and those who had migrate to greener pastures.

It also means that companies become reluctant to invest in the language itself, including hiring programmers. It becomes harder to find, thus, harder to pay, compared to what’s more abundant. That’s when migrating to a new platform with cheaper workforce becomes an option for a company.

Photo by Arif Riyanto on Unsplash

The COBOL scenario is just the same as with Visual Basic, ASP .Net, Pascal, Fortran, ActionScript, Objective C, Haskell, Ruby, and many more collecting dust in the servers. They completed their cycle in technology, and better languages took their place with more features and toolsets, or less annoyances, like PHP did it for most of the Internet mid 2000s. It will probably happen with C and C++ once Rust becomes the standard for Linux Kernel development.

PHP rise to the top mostly relates to Wordpress first appearance and PHP easiness to sell in the server space, compared to other alternatives, specially those that needed to be compiled into binaries, even if these alternatives had more features or better performance when PHP once suffered a lack of both. It’s because Wordpress rise that media conglomerates, afraid of their work being killed by “a guy with a blog”, accepted the trend and started using Wordpress to power-up their internet presence. Wordpress even has a VIP mode for these corporations.

This “hard-lock” on PHP is changing now, mostly thanks to cloud services offering new platforms for other programming languages, but it’s not surprise how easy is to rent a cheap server with PHP even to this day and start in one day. The thing is, today is also easy to rent a cheap server running Node.JS, or AWS Lambda. You don’t need years of training to use a cloud provider, or even a serverless service, even Google offers a tutorial to use Google Cloud Platform.

That being said, PHP is still a very handful language to enable websites. As more people dived in, tools appeared from both the community and officially: Opcache for the I/O performance penalties, PDO for a common database layer, Autoloader to make large projects manageable, Composer for dependency deployment, PSR to standardize code conventions, PHPUnit for testing, PECL for extensions, and so forth.

So, back to the concept, fading away means being replaced. It’s usage doesn’t grow, but becomes stagnant. The only thing that can happen is becoming slowly replaced with other solutions. It doesn’t happen one night, it happens in years.

From a corporate perspective, changing the stack requires spending resources with no immediate ROI: migrating to a new technology stack doesn’t come for free nor the next day. Even worse, some tools may not exist, like profiling, debugging, or even deployment tools, and these must be done from the ground up.

This makes “techstacks” migrations a hard sell for the boss. Not the ones that are responsible for you, but the ones that are paid to keep profits higher than last period. Unless you can prove there is a new “business opportunity” the old stack is not capable of, or better, it’s objectively losing money compared to the other new stack, it will be always extremely difficult to change something that is already working.

The hammer is reliable. The nailgun is better.

To put in context, and checking what W3Tech says about PHP, you will see that PHP still runs the Internet in terms of what is most used, but not on 100% real traffic but rather top sites, which include non-US platforms. In other words, if Facebook uses one PHP script then it doesn’t mean the whole platform is on PHP — more on that company later.

Wordpress is still widely used as the de-facto CMS which, paired with WooCommerce, has become the first option for businesses. Surely there are SaaS that offer the same, but it may show that there is no need to fix something not broken.

Percentage of websites gathered by W3Techs.com using server-side programming languages

The above makes things clear: PHP is still a tool to consider for any web project. Wordpress is the pinnacle of what PHP has excelled at until now. There is still new sites being created using PHP. It’s still perfectly normal for a single person or two to build an Internet business when PHP fills all the checkboxes… until its not.

Today there are a lot of web technologies you can use: WebRTC, WebSockets, QUIC, HTTP/3, WebAssembly, WebAuthn, Progressive Web Apps, Machine Learning, JSON Web Authentication, gRPC, and Server Side Events, just to name a few. These have enabled online chat systems, multimedia streaming, constant live data, new authentication mechanisms, you name it. These are things that PHP makes from hard to impossible to work with; hard like streaming large files without choking itself, or impossible like WebSockets.

Hack is the future for nobody but large corporations since they have money to burn running HHVM in the first place…

Since there is a lot of work, it has become normal to transition from one language to many, or pushing service to a company that provides the feature you need, like having a video platform handled by Mux, and events propagated by Pusher. Someone may say you are paying for the convenience, but others will say you’re paying because your tech stack can’t handle that.

On the other hand, you can have everything in your premises. The front end can work under PHP, or just be a Single Page Application (SPA) on JavaScript or a framework like React, Angular or Vue. The backend can be running by applications on Rust, Go, F#, HHVM, .Net Core, Node.js or whatever. Because PHP can’t do everything, development hell starts and consistency is lost rapidly. You start to depend from one ecosystem, to too many.

It’s no surprise that a PHP project is coupled with other SaaS or runtimes made on Node.js, Python, Go or Rust, adding another codebase or application to maintain. This can have more drawbacks than benefits, as you have to handle two (or more) deployment schemes for each part of the project.

While there are few people that can handle everything, it’s very unlikely to offer a contract to a single person, mainly because people who can handle everything are few and far between, and don’t come for cheap, either.

“But this great company uses PHP”

One thing I get a lot is “but Facebook uses PHP” like it’s thriving web technology. Top companies that have started with PHP have clearly stated that Hack with HHVM — “Modern PHP but eating your RAM” — is the corporate successor:

Note that I emphasized “corporate successor”. It’s Hack the future, then? Indeed, Hack is the future for nobody but large corporations since they have money to burn running HHVM in the first place and they don’t want to migrate 90% of their code. It’s the rest non-millionare companies who are stuck with PHP and cheap servers.

Any corporation with big piles of money can create their own language for their own interest, like Facebook, Apple, Google and Mozilla did, because they have the people and minds to do it and services to implement it. We are just the collateral, for the good and bad.

Having a language with a steady demand internally allows for its progress, even if that sometimes means taking not-so-good decisions.

It’s enough, until it doesn't

It’s kind of sad to say sometimes “you can’t do that on PHP”. The new JIT engine is appreciated, but it’s not the magic bullet to put it toe-to-toe with other rising languages. Performance was an important problem for PHP, but now it’s not the only problem. The Internet is evolving, PHP is not.

Photo by Carl Heyerdahl on Unsplash

Today web-pages are only the starting point. The ongoing COVID-19 pandemic has shown that you need systems that react to the ever-changing state of different data types, through different channels, not only HTML pages. As of today, PHP is not enough, and by the time it becomes enough — seeing how slowly has evolved lately — developers will have better tools. Nobody will wait for PHP to modernize itself, and no business does. That is called progress: new tools replace the old tools.

The problem arises when you need more than just showing a webpage with basic interaction. Just then it’s when PHP shows its more than two decades of age and how is so out of touch with today’s technology and product needs.

I’m surely not the only one that has waited long enough for PHP to become a decent technology competitor. PHP is very convenient from a business logic point of view, since its syntax allows for very expressive ways to declare actions in expert hands, especially on the “business logic” part, but it doesn’t do everything.

PHP is the present. Not the future.

I think these paragraphs denote that PHP is still king because of its nature. There is no language that gained so much traction while offering convenience and maturity, but not features — again, the Wordpress-effect.

When PHP will be phased out? Everyone is just a few clicks away to create their own portfolio, shop, image gallery, cloud storage, team chat, and so forth; no hosting, no server and no code required.

Personally I think we’re already past the “killer app” like Wordpress was and now, mostly due to the proliferation of SaaS and one click installs. We are in the “killer ecosystem”, the one language that already figured out the parts while you bring your own glue. Maybe is Node.js? Maybe is Go? Maybe is Python? Maybe is TypeScript compiled into a binary? Maybe is a Garbage Collector for Rust? May be an entirely new language?

Maybe is PHP 9?

I can see some people hoping for a big rework for PHP. Unless something changes inside Rogue Wave (Perforce) to push the Zend Engine technologically forward, absolutely freaking not. They’re probably up their asses trying to sell Zend Server instead. I don’t think they’re successful when you consider the trend of big companies moving away from PHP as soon as they can, and making blog posts like it was a big middle finger to everyone.

It’s not that PHP will stop being used tomorrow: it still works and it’s very easy to pick up, because there is always an MVP to start that doesn’t require fancy stuff… yet. It just that PHP is the present, not the future, and the ones responsible for that don’t really care. Maybe they will once a new language comes offering the best of PHP with the best of other languages. Hack just proved that there was a market for corporate-grade PHP with great code reuse.

Once the next big thing takes the Internet by storm, it will be too late for PHP to catch up.

There you have it. No language is entirely dead. PHP is not dead, is just that other languages have already progressed past it. Of course, these are not so battle-tested as PHP… but they’re getting there.

It’s easy to sympathize with angered fanatics of languages when they’re told to try another tool when you consider humans have an inherent fear of the unknown. That applies to getting out the comfort zone into new things, which in this case, is migrating from a trustful language, like PHP, to other better suited for your needs. Nobody will die for just “wasting” a week or month to learn and know the new ecosystem. At worst, you learn where not to go again, like when you pick wrong your vacation destination.

I learned through my years of problem solving through software development that walking — not running — to the horizon in technology is part of the job, even if that means to accept the things we once loved are meant to be…

…left behind.

--

--

Italo Baeza Cabrera
The Startup

Graphic Designer graduate. Full Stack Web Developer. Retired Tech & Gaming Editor. https://italobc.com