laitimes

In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?

author:Not bald programmer
In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?
According to WordPress co-founder Matt Mullenweg, PHP's audience has dropped dramatically, presumably influenced by WordPress's "JavaScript-first" proposition.

The TIOBE Programming Language Popularity Index has been updated with the soul torture question "Is the magic of PHP dissipating?" In April, PHP ranked only 17th on the TIOBE Programming Languages Index, "its lowest ranking ever."

IT'S NOT JUST THE TIOBE CHARTS THAT HAVE EXPOSED PHP'S DRAMATIC DECLINE IN POPULARITY. In the annual Stack Overflow Developer Survey, PHP's share of the market also dropped from 30.7% in 2018 (i.e., the percentage of respondents who use PHP) to 18.58% in 2023. The JetBrains Developer Ecosystem Survey observed a similar trend, with PHP falling from 30% in 2017 to 18% in 2023. And this last statistic is particularly noteworthy, as JetBrains (and WordPress hosting provider Automattic) is one of the biggest sponsors of PHP.

In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?

Developer survey results published by JetBrains.

Nowhere is this downward trend more evident than in BuiltWith, where PHP's popularity growth has fallen off a cliff since the end of 2020.

In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?

BuiltWith 公布的 PHP 趋势图。

A survey as of November 2021 revealed that PHP still accounts for more than 30,000 of the top million websites on the internet. But now, more than two years later, its proportion has slipped to about 15,000. And at the time of writing, BuiltWith Quotes has published an actual share of 18.19%. The 18% percentage is in good line with the findings of Stack Overflow and JetBrains, so we can almost certainly be sure that PHP's popularity among developers has shrunk from about 30% to 18% today. In other words, a 40% drop in just two years.

So what's the takeaway? What has changed in the last few years that PHP has rapidly lost out of the competition for web programming languages?

WordPress 高调宣布"JavaScript 优化"

Arguably the biggest reason for PHP's decline is that WordPress (by far the most popular web content management system) is moving from PHP to JavaScript. Matt Mullenweg, co-founder of WordPress and CEO of Automattic, spoke about this at WordCamp Asia 2024 in Taiwan last month.

In response to a question from the audience, he said, "I feel like most of the new code in WordPress is written in JavaScript right now, and this trend has been going on for a while. So in every sense of the word, Gutenberg has turned into a JavaScript-first project. ”

That's right: Matt Mullenweg bluntly says that WordPress is now a "JavaScript-first project". The Gutenberg he was referring to was the company's controversial new user interface, and the main push for JavaScript to replace PHP entirely. Of course, he admits that switching from PHP to JavaScript "wasn't easy".

In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?

WordPress 联合创始人 Matt Mullenweg 在 WordCamp Asia 2024 大会上。

That's not to say that WordPress doesn't rely on PHP anymore. After all, at the time of writing, I happened to type this article into the WordPress URL ending in "/wp-admin/post-new.php". But let's just say that for now, the future of WordPress has been determined to go down another path.

Mullenweg also said that he would like to see further improvements in WordPress - surprisingly, he has started to look at these changes from a JavaScript perspective. For example, PHP is a server-side scripting language (meaning that the code is usually processed on a web server), and Mullenweg wants WordPress to use JavaScript to put more of the work done on the client side.

He said meaningfully, "I really feel like we should leave more of the processing to the client." For example, for the content being edited, this part of the processing can be handed over to the client. This speed of running JavaScript in the browser can be faster, as virtual machines and extremely powerful processors are now quite common. ”

Towards the end of the presentation, Mullenweg was asked how he felt about the Gutenberg project and how difficult it was for developers to contribute to it. The developers who asked the issue also wanted to "lower the level of abstraction in Gutenberg".

Mullenweg responded, "Speaking of implementation, I think you have to adapt to this development. I think Gutenberg's approach to development and JavaScript-first philosophy is the future of most web development efforts. By the way, I actually had to re-learn these things, which are also different from the way I was used to them. Maybe we could tweak some of the abstractions a little bit simpler, but overall, I'd choose to dig a little deeper. ”

He added that the Gutenberg project, including the transition to JavaScript, is far from complete. "When we started the Gutenberg project, we knew it was going to be a 10-year project. We're only 60 to 70 percent done. ”

In the meantime, on the PHP Foundation's side......

Admittedly, the WordPress project (and the biggest driver of PHP's continued popularity on the Web) is firmly moving towards the world of JavaScript. This will almost certainly discourage more young developers from choosing PHP, while forcing other developers, such as those dedicated to serving WordPress customers, to switch from PHP to JavaScript.

But the good news is that there is still a significant portion of the developer community that will continue to use PHP — after all, the 18% in two massive developer surveys corresponds to a sizable working audience. And the PHP Foundation will continue to support them.

The PHP Foundation was officially established in November 2021 with the desire to take on the management responsibilities of the PHP project as a non-profit organization. The PHP Foundation is a consortium of companies led by JetBrains, including Automattic, Zend, Laravel, and Acquia (Drupal's host). JetBrains engineer Roman Pronskiy is the project leader, who is currently titled "Head of Operations" on the Foundation's website.

At the Laravel conference in February, Pronskiy focused on technical issues, while acknowledging that "the biggest task of the PHP Foundation right now is to turn around the image of PHP in the public mind." While he didn't specify what caused PHP's declining public image, Matt Mullenweg gave a pretty general answer when he explained why WordPress was moving to "JavaScript first." Regardless, Pronskiy is quickly jumping into the development of the PHP project and has assembled a full-time team of 10 paid developers.

In just two years, the usage rate has dropped by 40%!Why is PHP, which was once popular all over the world, gradually losing its advantage?

PHP Foundation Team.

All in all, PHP in 2024 has almost become an "orphan" in the web development field, while JavaScript is the darling of the web development at home and at school. Even more sad for PHP is that the current trend of declining popularity is unlikely to stop anytime soon - after all, the WordPress development team is still actively adapting to the new JavaScript specification. But at least the PHP Foundation is still working on it, and maybe the decline will gradually turn around.

Original link:

https://thenewstack.io/why-php-usage-has-declined-by-40-in-just-over-2-years/