You’ve probably heard about how the new WordPress Gutenberg editor brings block-based editing to WordPress.
There is a change going on behind the scenes that casual users might not notice, that Gutenberg blocks are made using JavaScript (React, JSX, and ES6), not PHP. That change, along with other shifts in web development, might have you wondering, “is PHP dead?”.
So…is it? Should we call the funeral home and start the preparations? Well, first off, it’s important to point out that there’s a big difference between wanting PHP to be dead and PHP actually being dead.
People have been calling for the death of PHP for years now (you can find “Is PHP Dead?” posts as far back as 2011). And yet, PHP still persists…
In this post, we’ll dig into the data and show how PHP isn’t close to being dead (even if you really wish it were).
- Is PHP Dead? Only if You Ignore the PHP Usage Statistics
- PHP Is Faster and Better Than Ever, Too
- It’s Easy to Find PHP Developers
- You Don’t Have To Like PHP, But It’s Not Dead
Is PHP Dead? Only if You Ignore the PHP Usage Statistics
Ok, PHP might not be the best or the most modern programming language. But that doesn’t mean it’s dead, and it’s pretty tough to argue with the PHP statistics here…
First off, let’s look at what W3Techs has to say.
According to W3Techs’ data, PHP is used by 78.9% of all websites with a known server-side programming language. So almost 8 out of every 10 websites that you visit on the Internet are using PHP in some way. Which leads us to this fact…
To be fair, that number is declining. In November 2017, W3Techs had PHP as the server-side language for 80.1% of websites. That number dropped to 79.6% in June 2018, and now it’s down to 78.9% when we’re publishing this post in November 2018.
However, you also have to take some of the statistics with a grain of salt. Some of these scanning tools simply look for the X-Powered-By
HTTP header. Some hosting providers, including Kinsta, remove these headers from broadcasting on the server for security purposes. Therefore, the number of sites using PHP could, in fact, be higher.
But when the number is still over 75%, it’s tough to use that decline to pronounce PHP as dead.
These numbers really shouldn’t be surprising if you think about it. First off, WordPress, the most popular content management system in existence, uses PHP. Given that WordPress powers over 34% of all the websites on the Internet, that’s a lot of sites using PHP right there. Want to know which PHP version are you running? Check out our guide on how to create a phpinfo page.
But it’s not just WordPress, either. There are tons of other big and small sites built with PHP. For example, MediaWiki, the software behind Wikipedia, is written in PHP. And oh yeah, both Drupal and Joomla use PHP, too.
PHP Is Faster and Better Than Ever, Too
With the latest versions of PHP, PHP is faster than ever. Our recent PHP benchmarks show a huge performance increase for PHP 7.X over PHP 5.6.
In our tests using WordPress and popular eCommerce plugins like WooCommerce and Easy Digital Downloads, PHP 7.3 was pushing 2-3x the number of requests per second as PHP 5.6. And PHP 8.1 which Kinsta made available recently is even faster.
Better yet, PHP 7 also stacks up favorably against other languages, as well.
Beyond that, PHP 7.X versions also bring new improvements for developers like:
- Combined comparison operator
- Null coalesce operator
- New type hinting
- Anonymous classes
- Nullable types
- Iterable and void returns
- Multi-catch exception handling
- Keys usable in lists
- Trailing commas
- More negative string offsets
- Number operators and malformed numbers
- HTTP/2 server push
Of course, you’ll only notice these improvements if you’re actually using the latest version of PHP. Unfortunately, that’s often not the case.
According to WordPress.org, ~64.0% of WordPress sites are using PHP 7.1 or lower, with 22.9%, the plurality, using PHP 5.6:
PHP versions 7.1 and under no longer receive active support and lost security support as of 2018 and 2019.
The fact that so many websites are running on a PHP version that’s officially reached its end of life probably doesn’t help PHP’s reputation with developers.
Read this post if you’re still not sure why you need to update your PHP version.
It’s Easy to Find PHP Developers
Because of PHP’s popularity, it’s easy to find PHP developers. And not just PHP developers – but PHP developers with experience.
More importantly, PHP developers themselves seem to be doing just fine, as this Tweet from Brandon Savage so eloquently points out:
If PHP is dead someone forgot to tell my bank account.
— Brandon Savage (@brandonsavage) October 28, 2018
For newer frameworks, it’s harder to find developers, especially ones with experience.
More importantly, sometimes experience just flat out isn’t possible without a time machine. For a humorous take on it, there’s this Reddit post where a job description wanted a React developer with 5 years of experience back in 2017, at which point React had only been around for ~4 years.
Besides finding. a PHP developer it is relatively easy to learn the language. To help you we collected together some of the best free and premium PHP tutorials in this post. Happy learning!
You Don’t Have to Like PHP, But It’s Not Dead
You might not like PHP. Heck, even though we’re an application, database, and managed WordPress host, we’d be lying if we said all of our developers love PHP.
In fact, both our MyKinsta dashboard and affiliate dashboard are built entirely on Node and React, which are both JavaScript based, not PHP. But again, not liking PHP doesn’t mean it’s dead, or even dying.
Bjarne Stroustrup, the creator of C++, has a pertinent quote here:
There are only two kinds of languages: the ones people complain about and the ones nobody uses.
Yes, PHP does seem to be losing some steam according to W3Techs’ data. But even if PHP keeps decreasing at the same rate, it would take 25+ years before PHP even dropped under the 50% mark!
In the end, all of these posts about “Is PHP Dead?” are really just examples of Betteridge’s law of headlines – “Any headline that ends in a question mark can be answered by the word no.”
What do you think? Is PHP dead? Do you love PHP? Do you wish you could smother PHP with a pillow? Let us know in the comments!
If people think because a language is modern, it means it’s good, so they are wrong.
I’m a senior PHP developer, I have years of experience in it, I can talk in PHP easier than my native language.
I know PHP isn’t dead but it makes me worried about my career, you should be worried too.
You should know that nearly no new big company start their big app in PHP, for you as a developer it means less opportunity to work in professional companies.
The other concern is that you will get far less salary in compare to other developers/programmers, because it’s so easy to get highly experienced PHP developers everywhere with low salary demand.
My suggestion to who read this far is to keep their knowledge of PHP as it’s quite valuable and PHP isn’t going to die but go learn about Go and/or Node.js.
You are right, but on the other side it means you can always find a job easier and faster with PHP.
Does it really speaks by itself that hosting providers, including Kinsta, remove headers that identify PHP servers? I’s obvious that over 75% of the web is insecure just for the fact of using PHP. So the question is not ‘is PHP dead’ but ‘please, turn surgery off, cut off this tubes and let the patient rest in peace’. PHP will never be secure by desigh, because author of PHP invnted PHP language occasionally, it is actual a scripting extensions over OS API, so it is not designed with security in mind, totally. This differs new wave of languages like .NET Core and Java, which actually designed with security concerns, so yes, they are difficult to master, difficult to support, difficult to develop, but, by design, are more secure to use in server-side development compared to PHP and sometimes even faster, more performant and flexible than PHP.
You are talking about PHP3 that it was -err- amateur.
PHP4 was a large improvement, but PHP5 was a totally different beast: object are finally first citizen, hierarchy, etc.
PHP6 was a dark page that no-one want to talk about.
And PHP7 is a huge step forward: closure, reflection, typed strict check, and so on; all the missing features are in, and now we can talk to features parity with other languages.
PHP is inconsistent for his legacy, but it’s mature and flexible.
@m47730:
So, basically PHP 5 ran to make something that Java and C# did since the beginning of both.
Then they did in 10 years with PHP 7, what Java and C# done like years before (since Java 7, and C# 3); and yet making concurrency on PHP is painful, and complex… while on Java or C# you have that by design at their respective jvm and clr.
So, if you want to know what PHP’s next version will look like take a look a current versions of Java, and maybe you won’t get all the features.
PHP is just a language. You might as well say French people can’t add up because you prefer speaking English. You can write a secure WWW application in PHP more easily than in Java, but if you chose, you can also write an insecure one more easily.
If people think because a language is old, it means it’s good, so they are wrong
If PHP is not dead, most of the PHP pages are.. just see that 80% of WordPress is outdated, WordPress represents almost half of PHP usage and is already shifting to other technologies
If people that write articles cared more about writing great material like you, more readers would read their content. It’s refreshing to find such original content in an otherwise copy-cat world. Thank you so much.
It appears to me that most of the people who say PHP is dead are engaging in wishful thinking. Maybe they’d like to personally kill it? Unlikely.
Yeah PHP will die even PHP8 JIT compiler is faster than GCC (C++ Compiler).
People are so ignorant.
PHP is not dead at all, even it became more powerful than any other programming language.
Also, PHP is no longer a “web” only language since PHP7.4 which offers JIT compiler as an experiment.
But PHP8 will have it.
Here is comparison just for you :)
Hell yeah, PHP7.4 compiler is the fastest today :)
https://www.developpez.net/forums/attachments/p462907d1/a/a/a
In my opinion, you will find this kind of conclusion depending on who you ask. Someone doing PHP will tell that, obviously no, that PHP is stronger than ever.
But someone doing other stuff will tell that her/his platform is the one.
In reality doing such statements as “PHP is running 80% of the pages” is irresponsible, there’s no way to know. With no doubt, PHP is one of the most popular languages in the word, but, we need to know that in tech industry nothing lasts forever.
I mean, a lot of people saw the dead of (Visual) Basic, Fox Pro, Pascal, WebObjects… even within some platforms there are frameworks that didn’t evolve as expected.
If we look for trends, we can see that there’s an obvious down on the PHP usage, not because the language is bad or not, but because of the improvements on the industry. Back in the days, when you wanted to do some Java WebApp you needed to know Tomcat, Servlets, JSP, etc… and, PHP or PERL didn’t require to learn “too many things just to push a page”. But, the web became something else than pages and there is where PHP has been always behind.
Yes, you can grab a $0.5 USD host, drop some lines in VS Code, connect to an FTP server, and start doing something in the web… but, when scalability is a matter, not all languages can make it well, even cool languages today like python (that’s why there was the need to create cython).
So, it’s ok you like PHP, it’s ok that you can make money coding on PHP. What is not ok, is to deny a trend that’s happening (https://trends.google.com/trends/explore?q=%2Fm%2F07sbkfb,%2Fm%2F060kv,%2Fm%2F05z1_,%2Fm%2F07657k,%2Fm%2F06ff5), and stick to some language as if it was marriage.
Remember, languages are just tools, you don’t have to give your loyalty to one or another. Be loyal to yourself, to your growth, and keep doing what a programmer do: TO SOLVE PROBLEMS.
PHP Running 80% of websites sounds like a very important statistic. But how many of that 80% is old WordPress sites that get like 3 visitors a month? I’d rather see what % of web traffic goes to sites that run PHP. Is this sort of data available?
I don’t get your summary. At the end if all the big website-builders change from php to something else those 80% will be dismemberd. A lot of non-programmers use wordpress, joomla and drupal but have no idea what is happening in the background. as soon as they update to a version withouth php it will be over. This step could take 25years or 5years too. Just a matter of how fast those big players will switch. but as they’re making good money why should they invest right now to change it?… However they’re anyhow already began as you wrote in your article about wordpress…
Hi Peter, the article is only a response to the common phrase “PHP is dead”. Right now in 2020 and in the near future, it certainly isn’t – that’s all the article saying.
Now 2021, PHP still the best choice for learning compared to other languages because there has JavaScript which is familiar in coding rules.
Almost 8 out of 10 websites use PHP in some way. If you are wanting to work with server aide programming it is a great entry point. You can start with the basics (WordPress admin for instance) and work towards object orientated PHP which will allow you to springboard to other languages (Golang, Phython, Node.js for instance). You can also start to look at working with client side interaction with PHP through javascript/ajax for instance.
To summarize, PHP has a great community, lots of resources and employment opportunities.
So, why not learn it?