Ask HN: Why Isn't PHP Dead Yet?
PHP Should Be Dead… So Why Are Developers Still Building Amazing Apps With It?
Everyone loves to dunk on PHP. New devs sneer at it. The community treats it like a relic. Even after its latest update, many still consider it a "bad" language.
And yet… people keep using it. Not just using it—building successful, scalable, money-making applications with it.
If PHP is so awful, why hasn’t it died? What’s keeping it alive while so many other languages have faded into obscurity?
Let's hear it—why is PHP still standing?
"PHP should be dead"
Says who ? PHP works. Has a great ecosystem. A hell of a lot more stable than JavaScript ecosystem and package management. Tons of investment in frameworks like Symfony and Laravel. Great out of the box Hosting options. It just works. Upload index.php and boom. Then you have the beast: WordPress.
Don't get me wrong. I like other languages too (except JavaScript). There is a place for every language and PHP is no different.
I honestly think that PHP haters are just jealous because its supposed to die (in their own minds) but they are not able to accept that it is everywhere.
"says who"
Says the likely majority of us who've only experienced WordPress.
The experience of having to fix your companies hodge podge of dubious quality plugins in an antiquated code base. Then there's the legacy PHP applications...
I'm not actually rejecting your point as such, Laravel is on my to look kick the tires list and modern PHP looks fine but I can empathise with anyone that comes out with the impression its an awful technology.
"I like other languages too (except JavaScript)."
Situation seems similar come to think of it, ~ last 5 years of tooling & language features compared to what it was 10 years ago might as well be different language & ecosystem. Not suggesting everything is fixed in JS/TS land but as long as you remain dubious of anything from Vercel or Meta things aren't that bad.
that was the most fantastic approach here. You're completely right
PHP is already in mature stage, it has integrated support for many libraries like MySQLi, PDO, curl etc.
A huge community is also a major plus point.
And the foremost point is because of WordPress which run on PHP, it's empowers 62.8% of the web including big sites like Tech Crunch.
Third and more practical one is because of old conservative developers who are very resistant to change.
Also it is supported by many web hosting provider by default, due to its availability and integration with cpanel and WHMCS. Thus many personal blog owner prefer php.
It made a lot of really good choices in the late 90s when a lot of dot-com companies started and a lot of people around the world started getting interested in making their own websites. It eventually snowballed to the LAMP stack which became the most user friendly way of doing stuff on the web on low budget. The inertia from this is massive so it's staying for a bunch more years.
PHP is worth at least having a passive familiarity with for the same reason Bash is, at least if you're in the web dev world.
That's my contribution from https://hiandrewquinn.github.io/til-site/posts/php-is-web-sh... in addition to the other stuff folks are saying here.
Replace PHP in your post with most any other older open source language and its likely the same reasons: it works, there's lots of docs, the community is huge, there's a large ecosystem, etc.
Any language has potential to have horrible or wonderful code written in it.
but sometimes we even lose out on jobs because we're loyal to php. Especially for freelancers :(
If you're a freelancer you're subject to what your customer wants. If you built custom decks and people started to not like the materials that they bought from you and you constructed, you'd have to change materials to stay competitive.
Adding tools to your toolbelt is part of the craft, no? You can add another language to your roster without abandoning PHP. I used to write PHP, and will write it happily after a refresher if I need to.
However, I learnt ton of languages after I learnt PHP. That shouldn't be an issue.
On your question, PHP is alive because of the same reasons why FORTRAN and even COBOL alive. It's useful.
It's easy to deploy. A lot works out of the box without having to install any 3rd party libraries (PDO database access, CURL, file and directory management, session management etc.) And for most tasks it is fast enough.
There are no bad languages. Only bad engineers.
An engineer should be able to solve any problem given any tool. Unlike other disciplines, when we are given a hammer everything does become a nail.
But a bad engineer will strike the hammer poorly and bend the nail, and blame the hammer.
So long as there is something that loves something, that something will exist. You can keep anything alive if you heart wants to. Some people really love PHP, and that's kinda beautiful.
I'm one of them. Almost everything I build for the backend I do with php
Why do you love it?
> 'Replace PHP in your post with most any other older open source language and its likely the same reasons: it works, there's lots of docs, the community is huge, there's a large ecosystem, etc. Any language has potential to have horrible or wonderful code written in it.'
why else wouldn't I love her?
Once people realized its actually more secure and performant than java you saw big companies using it such as Disney Parks. This was new they had been using java for at least a decade before moving to php for developer productivity. I used to write java for them and you had only a test server, you had to know the language well because you had to wait 30 minutes for your servlet to compile in a compile wait list on the server. With php you could easily test locally, and they used php off the shelf so you no longer needed to know all the quirks of Disney's proprietary Tea servlet templating system.
PHP works, quick to build quick to deploy
With frameworks like Laravel, PHP can be super productive, especially for basic CRUD apps. Also, it is incredibly simple to deploy compared to a more "modern" cloud stack.
I would go as far as to say that it has the same level of scalability as nodejs
Whenever someone says PHP doesn’t scale - just point to Wikipedia or any NSFW site ever as proof that’s baloney. Facebook and Slack still use tons of it internally.
If someone says server-rendered HTML doesn’t scale or hurts conversion, or that we truly need a SPA to maximize sales - just point to Amazon and eBay, as proof that’s baloney.
Most colloquial programmer wisdom, I have learned, is baloney.
It's pretty likely a PHP site written 5 years ago still works fine today. Javascript? No way.
easy to deploy, latest versions of the language are ok, has some of the best web frameworks to work with, absurd amount of experienced programmers can be found on the market
One word: WordPress.
And MediaWiki (Wikipedia) and Drupal too.
Because it's easy to deploy, that's the only reason.
Because it's not really that awful. You can knock out something useful very quickly, and if you're careful and have a little discipline, you can indeed maintain it. The almost infinite library probably has something to do with it, as does a teeming mass of developers that have a familiarity with PHP.
and that's why giant sites like wikipedia are still alive and kicking
¯\_(ツ)_/¯ The only languages no one hates are the ones no one uses. Hating PHP is a mostly a meme and an elitist virtue signal, and people still use it because it still works. Simple as.
well said :)
[dead]