I think this shows how much HN is a bubble in itself.<p>Most discussions here happen around new/exciting/cool/weird technology. And don't get me wrong, I love those discussions! That's why I come here!<p>But reality outside of this bubble is people building and maintaining web apps as efficiently as possible and PHP hasn't stopped being very efficient. On the contrary, it's getting better with time.<p>Interestingly enough, Ruby (my personal interest, here) has been steadily gaining share in that chart year over year, despite not being "cool" anymore.<p>If you ask me, it's good to have a dose a reality from time to time!
As an ex PHP developer, I don’t think it will ever go away. There is just way to much software that was written in PHP (e-commerce, blogs, CMS systems, Nextcloud/ownCloud, …) that isn’t going away.<p>PHP isn’t something I ever want to touch again (its libs are wonky and I dislike the syntax choices of the last years) but the execution model was sort of nice before the frameworks (an entry point with a clean state you can work yourself through).<p>The statistics are a bit misleading though. Just because 80% of the sites run PHP in some way doesn’t mean there are that many Jobs. A lot of the work with PHP world is not necessarily going to be PHP work (a lot of HTML, JavaScript and Plugin configuration) and there is complexity in learning your way around a system well enough to build plugins. The jump from beginner to expert has become harder for a new PHP programmer because the real programming is hidden behind a wall of already existing code that just needs to be installed, configured and customized.<p>I’m glad I got out when I did because I get to actually program APIs and Single Page Apps rather than just being a glorified PHP webpage mechanic.
PHP is a great fit for most web projects. It is battle tested with great backwards compatibility, fast, offers the best deployment story and combines the advantages of dynamic and static typing with it's gradual typing system (Think Typescript without the complexity of Typescript.)<p>The next version is even going to improve on its weakest point, concurrency, with Fibers:
<a href="https://php.watch/versions/8.1/fibers" rel="nofollow">https://php.watch/versions/8.1/fibers</a><p>Sure we all remember the bad old times and the horrible legacy projects that are still around but let's no forget PHP allowed the average Joe to hack up his own dynamic websites without jumping any hurdles. It helped democratize the internet for a while.<p>I really don't get why PHP is not more liked in hacker circles. Probably needs some new languages with slightly different syntax that transpiles to it for it to be hip again.
I wonder how much the results of this are skewed because PHP reports via the server response header that it is being used. Other languages like Elixir, Go, etc aren't so public about their usage unless one of their web frameworks adds it.<p>I'd also love to see a study like this instead focused on "How much of the active web is wordpress?" and "How much of the inactive web is wordpress?".
I'm curious how this changes if you remove PHP being used for WordPress (where the people using it probably didn't choose it). Do lots of companies still choose PHP for brand new projects? I know Facebook has a dialect they still use, but you don't hear much about it anymore.
The last few server-side languages I've used don't use extensions or publish a header banner. In many cases it's just not possible to tell what's running.<p>w3techs admit as much in their disclaimer. The data and conclusions from it are junk.<p>> In order to obtain any information from websites, we rely on the websites themselves, their owners or their webmasters to provide such information. Some websites are more open to sharing this type of information than others. Some technologies may provide more means to reveal information about their usage than others.
I'm a recent grad and my job is working with PHP. I had always heard and told jokes about PHP being old and washed up (my favorite what that it stands for "Pre Historic Programming"). Then I started using PHP. Some quirks I didn't like at first, and some I still don't love, but it really is a solid language. Funniest part is that I'm using 5.6 (we're working on migrating to 8). I'm so excited to get some of the more modern features too. It really is a solid language for web programming.<p>If I were to work on a large scale web project on my own though, I'd probably still choose JS, Python, or Go, but PHP is a language that's won my respect.
PHP has quite a few things going for it. File-system based routing before it was cool. Each request cycle is isolated, so an error in your script won't bring down the whole server. With shared hosting, you get something very similar to serverless functions today. The language was created with embedding tags from the start, so there is no need to build or use 3rd party template parser. Everything outside of php tags just gets outputted as strings, very similar to JSX. The biggest downside is (was?) C-style file includes, instead of packages.
I'd love to see this with wordpress filtered out. I think most small businesses and personal sites run PHP simply because that's what wordpress uses. Subtract wordpress from the php statistics and you get a real picture of "who's using what" without the skewed "I'm using php because I installed wordpress and I know nothing about building websites". This isn't to say people who know how to build sites don't use wordpress either, I'm simply stating that it would be more accurate to measure sites that aren't wordpress to see what languages are being used by companies on the interwebs.
Seems like a possibly good business strategy for w3techs.<p>They publish numbers that are very surprising to most people, like Python and JS are used on 1.5% of sites vs PHP on 79%, then offer some very handwavy text about the data ("In order to obtain any information from websites, we rely on the websites themselves"), and then offer a full report for $$$ where they probably more fully own up to how they come up with this clearly flawed data.<p>In the end the paying customer sees the shortcomings of the data, feels relieved that their assumptions weren't invalidated and has invested some money to doing due diligence.
I have to point out the obvious, that this chart doesn't pass the smell test and must have done something really wrong to conclude that in 2021, JS and Python power less websites than Scala.
I'm skeptical about the methodology here.<p>The Stack Overflow Developer Survey [0] is my go-to source for this kind of thing, and it has very different results. Of course, it's measuring overall popularity while W3Techs is looking at "server side programming languages for websites."<p>Here's how the ranks compare:<p><pre><code> Language W3Techs Stack Overflow
PHP 1 11
ASP.NET 2 8 (C#)
Ruby 3 17
Java 4 5
Scala 5 26
JavaScript 6 1
static files 7 2 (HTML/CSS)
Python 8 3
Cold Fusion 9 N/A
Perl 10 27
Erlang 11 35
Miva Script 12 N/A
</code></pre>
[0] <a href="https://insights.stackoverflow.com/survey/2021?_ga=2.236209345.190202062.1628102352-126161871.1625855113#section-most-popular-technologies-programming-scripting-and-markup-languages" rel="nofollow">https://insights.stackoverflow.com/survey/2021?_ga=2.2362093...</a>
How did Ruby increase that much lately?<p>Also, I'm surprised Python isn't more popular. 1% is (comparatively) tiny for a language that popular.
I use php for pretty much everything. Php has a lot going for it, there are tonnes of developers who knows the ecosystem. It works on every OS/plattform there is. The performance is decent. Any systadmin out there knows how to admin an php application. The tooling is mature and you are not bound to any specific editor or ide.<p>For me its the perfect language.
Not sure how representative this is of people actually writing code.<p>I run a bunch of websites doing various little things. One is a Wordpress blog. I wanted a blog-like site so that myself and a few non-technical friends could write and publish articles on a particular subject. The easiest and most reliable and well-supported solution was to just install Wordpress. Throw in a few plugins from the Wordpress repo for any functionality it doesn't already have.<p>I don't understand PHP particular well, and don't feel very inclined to learn it. But hey, I don't need to, Wordpress already works fine, and there's probably already a plugin to do anything I might reasonably want to code up.<p>I find some of the security practices disturbing - it seems to be standard practice for the web process to have full write access to all the code files and the database. If anyone ever compromises the server code, guess they have full access to pretty much everything. But whatever, it's a standalone server with nothing but the blog. I have an Ansible playbook for the setup, so I can kill it and spin up a new one if it ever breaks.<p>So there you go, I'm responsible for a PHP site without writing any PHP. Probably lists like this represent a lot more low-skill deployments of existing proven codebases than bespoke projects.<p>There's probably something going on about ease of deployment too. I much prefer writing Ruby/Rails apps, but I don't actually know of any existing ones that I'd say are easy to do a low-skill deployment of in the way that PHP is. The nice part about things that are terrible from a security standpoint like the web process doing all upgrades and plugin installs is that it makes it much easier for less-technical people to deploy and manage it. Or people who are high-skill, but don't feel like applying all their skills towards a task that already has a straightforward solution.
This is interesting from a 30,000 foot view, but without knowing the details on the companies and how they are using the language it is hard to draw conclusions.<p>For example:<p>- As many pointed out, are the majority of PHP just default Wordpress sites? I would rather know who built in a given language rather than installed a site that happens to use a language.
- I use to be in the banking world and it as all Java (or C++ for algo trading, Scala for data processing, but never NodeJS), but I haven't seen many new startups using Java unless the founders came from banking. The industry made a difference.
- How old is the company - a 30+ old company might have Perl.<p>Also, a bit surprised at Javascript, AKA NodeJs. I thought it would be higher.
I don’t even know what market share / usage statistics means here. The FAQ doesn’t seem to answer the question and the actual report is behind an order form. So: how is it calculated? Is google.com weighted the same as mom-and-pop-restaurant-near-you.com? If not, how are they weighted respectively? Of course there’s also the problem of identifying the language without an x-powered-by or similar signal, which several other commenters pointed out.
Methodology has at least two major flaws.<p>1- They say they only consider what the root of a domain is using, ignoring subdomains. Speaking for my own org our real work happens in subdomains running Django apps. Our www is just a WordPress site because we don't want to spend cycles writing/maintaining a simple blog engine.<p>2- For a lot of sites using e.g. Django there wouldn't be an automatic way of determining what language was used.
I think this is most indicative of the frameworks used to power the majority of the sites on the web, rather than the language chosen to power a custom application, and that is an important distinction for our audience.<p>Luckily for the majority sites on the Internet a CMS is exactly what's needed, and very often with more minimalistic custom development (plugins will take care of most of your needs). Thus with WordPress/Magento/Drupal being the heavyweights it's not at all surprising to see the statistics as laid out.<p>What I would <i>love</i> to see is a similar chart focused on bespoke applications, more like the kinds we would consider building for solutions, startups, and companies here in the HN space. I would guess it would probably hew closer to the stats in the TIOBE Index [0], but again one would want to filter specifically for web application development. Now those are some stats that would be very interesting!<p>[0] <a href="https://www.tiobe.com/tiobe-index/" rel="nofollow">https://www.tiobe.com/tiobe-index/</a>
This is probably correct and a lot of software still uses PHP. Wordpress being one of the huge ones. I actually see a lot of people still developing in PHP, though my own involvement finished years ago. I think because we sometimes operate in a bubble, it's always a surprise to see this
this comment section is deluded. its like they live in a bubble.<p>tons of companies use php, my company uses it even for modern development.<p>get out of your own bubble dude
We should distinguish between applications developed in PHP, from installations of apps which happen to be developed in PHP.<p>I suspect one would see the former drop off a cliff, whilst the latter will always be quite high -- due to first-mover effects.
Some ecosystems go extinct but others stabilize for long periods and <i>might</i> surge again under the right conditions. Python was around for decades before it became a good fit for data science / machine learning and interest in the language exploded.<p>Php seems to be in such a stable phase, fixing old issues, modernizing and powering real apps used everywhere. Wordpress is being mentioned, but don't forget that wikipedia / mediawiki is also php and what those folks are doing with wikidata is ground breaking.<p>There are plenty of scenarios in which php could grow again, e.g widespread decentralization using nextcloud, wikidata or similar.
Modern PHP is good.. I really enjoyed working with laravel, however when you're young and want to continue further in your career.. it's rarely used in big tech companies. I moved away from it since I join enterprise company. Still missed it, but anyway big companies tend to use python, java, c#, c++.<p>I missed php, but I don't hate python or c#. In fact I like them both as well. Also because they're all turing complete, basically we can create anything with it.<p>Side note: not sure what do they mean by websites, does microservices counts? because most backends are talking to other backends these days with many other languages too
I don't use PHP personally as a developer but most of the things I self host are written in PHP, (NextCloud, BookStack, FreshRSS, RSS-Bridge, etc).<p>Yes there are faster, easier, and more elegant languages but PHP isn't going anywhere.
This is fascinating as it goes contrary to the Google Trends data on a number of languages. For example google trends interest in Ruby peaked in like ~2011 and has been on the decline, however this shows that actual usage of ruby in production has been steadily increasing year over year since then and is now second only to ASP.NET and PHP.<p>This suggests that company adoption either doesn't perfectly track with or significantly lags behind community interest (by ~10 years), which is something I think we all know is true but this is the first time I've seen it measured in a meaningful way.
I don't understand how this methodology works. They claim "We investigate technologies of websites, not of individual web pages. If we find a technology on any of the pages, it is considered to be used by the website."<p>So then how on earth do they arrive at the claim that only 1.5% of websites use 'static content'? I would be astounded to discover that 98.5% of sites are using a serverside rendering technology to deliver every single page on their site (let alone their CSS, javascript, images, favicons, robots.txt files...)
I'm surprised nobody have linked the infamous "a fractal of bad design" article yet. It's particularly popular with people who have never written a line of PHP in their lives.
I like seeing trace amounts of Erlang on there!<p>I've been using YAWS as my web back-end for work projects, and a lot of my co-workers either raise an eyebrow or straight-up balk at it. Fair enough, it's pretty obscure, and the syntax isn't super friendly.<p>But then I watch them endlessly upgrade libraries, maintain toolchains, deal with exploits, etc etc, while my code sits on decades-old nuke-proof bedrock that no hacker in their right mind would waste time targeting (and likely would find impenetrable had they tried)
We keep "trying" to rewrite a legacy application, and said rewrite keeps failing, then we end up with what we tried to avoid in the first place: A Frankenstein one-off for some specific project.<p>A lot of people sing the praise of everything being type safe, but I think the dynamic typing of Php and its synchronous nature are what make it so productive.<p>Also, at least compared to its C# Frankenstein cousin, uses a fraction of the resources to do MORE work, that still amazes me TBH...
How is this state even determined? If we exclude Facebook & Wikipedia how much market share is left after that?<p>I ask as the statistic seems to be projecting that it is the most popular amongst people, but it feels like it is a legacy language. Maybe adding in how much new server unrelated to the legacy apps are written in PHP would be a good contrast.
So what's considered the cool stack right now? Being a PHP developer who built my own web app, NannyLogic, that's making money and love it, but also being fairly new to programming, I'm not really aware of what is or isn't cool in hacker circles but I'd be interested to learn new things.
Outside of Wordpress, I don't think the PHP ecosystem is in a great state. I worked with it recently and the availability of 3rd party libraries wasn't great. A lot of them were abandoned. Python and JavaScript have healthier ecosystems.
Does anyone have experiences with the HHVM stack?<p><a href="https://en.wikipedia.org/wiki/HHVM" rel="nofollow">https://en.wikipedia.org/wiki/HHVM</a><p>It looks interesting to me since it is written in PHP, C++, OCaml and Rust.
Nobody tell Jeff Attwood, he chose a complex tech stack for Discourse 10 years ago, with the explicit aim that it would be so easy and powerful that the “PHP virus” would be defeated.
So... how many of the sites use an unknown language?<p>Without this stat, all the other numbers are irrelevant, except to tell how many sites leak implementation details unnecessarily.
I find it funny that as ASP.NET keeps getting better it sees its adoption shrink.<p>I'm surprised by JS low numbers too, I would have thought it was close to PHP.
Proving once again that there are only two kinds of programming languages.<p>Programming languages that no one uses.<p>Programming languages that everyone hates.
I am guessing that market share is defined such that each domain backed by a wordpress instance (wordpress being written in php) is counted as one share, and gmail.com is counted as one share (or worse, because the survey cannot programmmatically determine what language gmail.com is written in, it is not represented at all in the count).<p>I doubt more than 25% of the hours spent by programmers on software that runs on web servers is spent on PHP code.
42% of all <i>websites</i> are on Wordpress, which is written in PHP.[a] The vast majority of those websites use vanilla WordPress out-of-the-box to serve a tiny audience.<p>If you look at market share by <i>traffic</i>, a much smaller share than 79% of the world's largest web sites (Wikipedia, YouTube, Google, Amazon, Facebook, Twitter, Reddit, Instagram, eBay, PornHub, etc.) run on PHP. Those websites account for the vast majority of Web traffic.<p>[a] Source: <a href="https://wordpress.com" rel="nofollow">https://wordpress.com</a><p>--<p>EDIT: I changed "0.0%" to "a much smaller share than 79%" because I was wrong about Wikipedia, Facebook, Pornhub and likely other high-traffic websites. See comments below.