The Reality of PHP and the Future of Web Development

The future of PHP has been in contention for years, leaving many wondering about how the web development industry will progress. This article serves to provide clarity about the reality of PHP and help us understand a present and future that serves others the most.

the Future of Web Development

The conversation discussing the death of PHP happens every year. There are many out there that want PHP dead and will shout its death from every street corner—equally there are those who think the idea of an expiration date is unnecessary or unrealistic. Within this article we will consider both sides of the endless debate to reveal the reality of modern PHP programming and look towards the future of PHP in web development.

The Current Position of PHP

PHP has become one of the most popular and dominant programming languages ever. Around 75 percent of all webpages are powered by PHP, and that statistic alone is enough to tell you that PHP is nowhere near dead—and if it is dying, it’s going to be a really long time before it passes!

Part of the reason why PHP is so dominant is because it is featured within many of the most popular eCommerce systems, platforms and frameworks. See the following programs and their approximate market share involving all websites:

  • WordPress (34%)
  • Magento (2%)
  • Drupal (3%)
  • Joomla (2%)

There are many more to mention such as Magento, WooCommerce, Laravel and OpenCart that are all expected to grow and this reinforces the fact that PHP isn’t going anywhere soon.

At this point I feel it’s necessary to acknowledge that I’m aware that our company CodeClouds offers PHP development services and it’s fair to assume that this article may contain some bias. That’s not the case! If PHP dies, I’m very open to that future—it’s not going to die unless it gets replaced by something better, and if it gets replaced by something better, then we all win.

So, Why Do People Suggest That PHP is Dying?

Given the statistics why do people dislike PHP or suggest that it’s on its way out?

PHP is old. In tech terms, it’s ancient. It was first introduced in 1994 and has had a long release history in which each new version has come with its own issues. It was considered a toy for a long time, and the relatively low barrier for entry meant there were a lot of bad PHP developers out there and it developed a reputation for low-quality code. The timing lined up just-wrong for that: it was popular with low-quality developers during the dotcom boom, and there’s a lot of old, bad PHP floating around the internet even today.

PHP has a famously ugly and inconsistent syntax, grandfathered in from its early days. It’s a lot like JavaScript, really: it wasn’t developed with the intention of taking over the internet, it just sort of … happened, and the team behind it suddenly had a lot more on their plate than they’d planned for. They’ve done a great job of updating it, but it still has boatloads of legacy issues that are never really going to come out.

PHP is Beginner Friendly, But…

Learning PHP is reasonably simple. Nearly all web developers would have learnt PHP at some point; its current necessity makes it almost impossible to avoid. Unfortunately, when learning PHP many of the resources are teaching outdated material. New developers and first-time WordPress users are learning suboptimal techniques for development. Older techniques are often rooted in the need to plug holes in the language that have since been patched over, and when used in PHP7 they create more issues than they solve.

A large portion of websites are actually using previous versions of PHP. Even for those that are using PHP7.1, active support and security support ended in 2018. Again, even though PHP 7 was a big improvement, many developers would rather work with a language that is actively supported.

What About PHP Within the Constraints of a Framework?

Stating that learning PHP will result in suboptimal code is only true in some scenarios. Each PHP experience differs with each developer, yet the most likely case is where an inexperienced developer is building a custom website from scratch.

Many developers now choose to specialize in certain PHP frameworks. Why? For work reasons, obviously, but also because many frameworks nudge you towards cleaner code. Some, such as Laravel don’t tolerate messy code at all. It’s important to realise that a framework does not guarantee cleaner code. To ensure cleaner code, you need to pick a PHP framework that suits your project needs and have the development expertise to remove any leftover complexity that doesn’t serve you—otherwise you’ll only end up with a well-framed mess. In saying that, such changes usually aren’t comprehensible for beginner developers—hence why PHP development jobs continue to flourish.

Let’s Talk About PHP 7

PHP7 was a very welcome and necessary update for PHP. Many of the complaints that led to the dislike and “it’s dying” attitude towards PHP were due to patchy older versions. PHP 7 was the revival of PHP. Not to say it’s perfect, but it’s significantly better

Websites using PHP 7 enjoy two big benefits: improved site speed and memory usage. A website using PHP 7 is able to handle 2-3x more requests than a website using PHP 5. Essentially, achieving much faster loading speeds even with a greater amount of users.

Furthermore, PHP 7 introduced a range of other benefits between 7.0 and 7.3 including:

  • Improved error handling
  • Type declarations
  • New combined comparison operator
  • New null coalesce operator
  • New type hinting
  • Trailing commas in function calls
  • More negative string offsets
  • Number operators and malformed numbers
  • HTTP/2 server push
  • Multi-catch exception handling
  • Keys usable in lists
  • Anonymous classes
  • Nullable types
  • Iterable and void returns

Are PHP Developers Still Getting Hired?

Yes! Of course, PHP developers are still hugely in demand and have nothing to fear. With a market share that big, any current PHP experts or beginners can expect to be able to find work for the next couple of decades at least. Whether you’re a general PHP developer building custom websites from scratch, or you’re a specialist with a certain CMS, platform or framework, I wouldn’t sweat it—PHP7 was a shot in the arm, and the language continues to mature and developer as times goes on. It may well go the way of COBOL in the future, but it’s not going to happen any time soon.

Difficulties For New Programming Languages

Part of the reason PHP is so big is because PHP is so big, if that makes sense. There’s a lot of work, which means a lot of developers learn it, which means it’s cheap and easy to find developers, which means business owners go looking for it, which means—

 

You get it. It’s also a lot easier to jump into than something (arguably better) like Node. The more complex the language or framework, the more development expertise a business owner will want. It’s hard to put your trust in a developer that only has two months experience, even if the framework has only been out for six months. Not to say that there is no space for other programming languages to prosper, but PHP is a snowball that has picked up a lot of snow, and it’s going to take a lot of time and concerted effort (or perhaps—as we’ve seen on a few sad occasions—one gigantic crash) to stop it.

Does PHP Have a Future?

The short answer, yes. PHP is here to stay and will be for a long time. It’s understandable that many developers have come to dislike PHP, but the notion that it’s dying is highly exaggerated. Technically, you could claim anything is dying, simply because time is passing. Languages do die off over time but some (like JS or PHP) simply mature like good wine.

Claiming that PHP is dying doesn’t serve us, nor does it serve us to say it’s the absolute best solution to all web development problems! The reality is, PHP is not going anywhere quickly and we will still need to find solutions using it and serve the massive population whose aspirations rely on it. 

Technology and programming will always progress and so will PHP. Maybe in twenty years time we may see another programming language take the throne and if that time comes, we can reap the benefits collectively. In the meantime, learn PHP first, then branch out into competing solutions like Node.

If you’re thinking of becoming a PHP developer then I greatly encourage it, there are a variety of frameworks, and platforms using PHP to specialize in, all which are in demand. At CodeClouds we often have job openings for junior and senior PHP experts, as well as plenty of specialist roles—if this sounds like you then please feel free to contact us.