PHP is a DeLorean. I think I encountered 10 segfaults in it within 1 year which is a complete joke. This was only two years ago.
It also includes breaking changes in point releases which is a nonsensical maintenance strategy - this is in stark contrast to the reputation of stability in a Corolla.
While PHP may have some strengths, it immediately fails this particular comparison.
As I remember it all the early languages that let you write code inline with the HTML were proprietary such as server-side Javascript built into Netscape's web server, ColdFusion, ASP, etc.
PHP was the first of these that was open source and basically competent which made it my #1 choice for making web applications in 2001. Compared to many other languages (say cgi-bin) it was pretty fast without a build step and had enough resource management that hosting firms could offer cheap PHP hosting plans which made world-changing open source products like Wordpress deployable.
It got long in the tooth quickly because people realized that to make quality web applications you had to have a part of your framework (a "router") which could serve different pages based on the inputs. For example, if you are doing server-side error handling on a form you either display a form that says "successful" or you re-display the form with error messages. You certainly can write PHP that does that if you have some discipline, but once you introduce a router you might as well write your "views" with some kind of templating system and after ruby-on-rails every language got frameworks, typically Sinatra-like, which were about as comfortable as PHP and that pushed you into having some discipline.
Yeah. I had a 1990 Corolla from its best selling car in the world period and it was functional reliable and designed with a lot of care even if it was a simple design compared to fancier stuff.
I’ve used PHP for more than 20 years. It’s my “go-to” language for the backend. I’m not a server programmer, and PHP is fast, well-supported, and, if you’re a decent programmer, you can write robust, secure, performant servers in it.
I also really don’t like the language. I’ve never warmed to it.
But I think it will still be around, as a principal backend language, for the next fifty years.
I've also used it for about 20 years now. Surprised you haven't warmed up to it. It's perfectly fine. I still use it for scripts from time to time even though I prefer TS now because it's got some good stuff built-in.
The article loses impact due to the way the author keeps self-conciously mentioning how the "PHP haters" are wrong instead of just explaining the possible usecase for PHP better.
I've never really used it but it would have been somewhat useful to know why anyone would choose this language for a greenfield project in 2025, given the choices available. The reasons given are pretty unconvincing to me.
Java is more akin to the Corolla. Utterly insipid (by design), lacking in refinements compared to competitors like the Mazda3, and made for people who just see it as a way to get from point A to point B.
PHP is the Hyundai Elantra of programming. It used to be popular because of low adoption costs but was the butt of jokes for a long time because of its questionable design and poor reliability. But like the Elantra, it has come a long way and is actually decent these days.
The author makes a fair point that the language is no longer the fractal of bad design it was in 2009, but doesn't make the case for starting a green field project with it in 2025.
What does it do better than other languages? The article mentions features that sound like parity with other modern languages, but nothing that stands out.
I think the author means the Nissan Versa of programming. Corollas are quite a bit more expensive and hold value longer. But both are very useful.
I've written more shell scripts than any other language for close to a decade now. The reason is simple: I'm not writing web apps. I mostly do system programming (that is to say, tasks needed to build or maintain a system or are generally user-focused yet non-interactive). You don't need more than a shell script for most of that.
My contemporaries will, of course, pooh-pooh a shell script on general principle. If it's not using a more "advanced language" it must be unreliable or unmaintainable or ugly. Yet the practical experience of writing programs in multiple languages over years leads me to the same conclusion: literally any language will do. You could use BASIC for system programming. You could use ASM. It will work. People will argue over whether one language is "better" than another, but who cares if it's better or not? If it works it works. But that's because nearly any language works for that kind of program. Other kinds of programs need advanced features, so you need a more advanced language. But for simple tasks? It doesn't matter.
To go back to the car analogy: you can use literally any car to pick up groceries. You can't use any car to pick up 3,000lbs of sandbags.
If we were scientists and not craftspeople, none of these discussions would be relevant. We'd pick up the tool designed for our specific purpose and not bicker over our personal preferences or idealistic principles. But our languages, and our approach to using them, is anything but scientific. We're just a bunch of tradies talking shit at the water cooler.
php is so boring and it works. i am so surprised to not see more jobs on HN for it. I don't really consider myself a PHP programmer, it just, what we use I dont think about it, almost ever.
I always found Hack interesting. It's PHP slowly transformed step by step into something closer to Java (Java isn't as bad as new grads claim, compared to PHP it's actually great). It's pretty much exclusively used at Meta.
Basically what they did is they had repeated codemods (changes to the entire codebase with automated tooling) that bit by bit moved PHP closer to Java. More and more static typing, generics, all the common Java ADTs (Vector, Map, Set, Pair, etc.), bytecode+JIT execution, etc.
Essentially instead of rewriting the codebase to a better language they just changed the language itself. Which makes sense since PHP is a much smaller codebase than the Meta backend.
PHP is so hard for me to describe. I used it a lot in the late 90s when we were migrating off mod_perl because it was a great way to add dynamic data to otherwise static pages, and no one really knew how to develop large sites yet. We were making it up as we went along. But ye gods, the language was bad. “A poor craftsman blames his tools” and all that, but imagine a screwdriver with 2 handles and 3 tips projecting at random angles. Sure, you could assemble an IKEA desk with it, but would you want to? And would you look suspiciously at anyone who claimed to love that weird screwdriver when the equivalent of a Snap-On was available for free from the same place they got the weirdo?
I think that’s the root of much of the horror. No one would bat an eye at using PHP to add little bits of server-side content here and there. It’s great for that! But then you see the giant castles of non-Euclidean horror built with it, and people pointing to them and saying “see what you can built with that weird screwdriver?”, and parts of the castles randomly fall off and kill their owners. No! While that’s impressive, it doesn’t exactly inspire confidence in the screwdriver, or in the people who keep using it to build things larger than it was clearly able to do well. But heaven help you if you point out that there are saner screwdrivers. “You’re just being close minded and out of touch! We added another handle to it and removed the razor blade so it’s much better now!”
Maybe so, but wow, it’s still one hell of an odd screwdriver.
PHP did well for ONE reason: it was really, really, really easy to deploy. This was, of course, underestimated by programmers in the know, but I remember first getting into web dev, and I could start putting real programs (!!!) on the web, in minutes!
I would say it was more like the bicycle. Cheap, no license, even a kid could be suddenly zooming around town with no ceremony, no red tape, minimal investment.
I haven't used it in well over a decade, but still remember fondly how great it was as a gateway drug to bigger and better things.
of all the reams of php snark the internet has produced, one line has stuck in my mind - "any fool could write php, and many did". both because it was funny, and because that lowered barrier to entry is actually a good thing. I want "any fool" to be able to program and if php supports that goal, more power to it.
It just moved the work somewhere else, generally an Apache config on a shared host. The user could very often just dump some PHP files in place and they'd be served up, but if you had to set up a new host then it was as fiddly as anything else.
This pattern also meant dropping everything the docroot, using .htaccess to hide things, having different behaviour depending on the global php.ini. All architectures had to be mashed into a request/response cycle (and anything more complex was no longer just drop the files in). It was a very long way from the idea of reproducable builds.
I agree it was popular, but not really for the right reasons.
I spent a few years trying to work on legacy PHP systems. Would never take another job using it if I had any choice. Most large tech companies do not have large PHP codebases, and most small ad hoc PHP codebases are awful to work with (in my experience), so the intersection of "uses PHP" and "higher quality software engineering" is pretty small. I won't say it's an empty set, but it's a small opportunity space. Meanwhile, the odds of having to work on really awful codebases are... high.
Generally - we live in a world with lots of fantastic programming languages, so I would never choose PHP for a greenfield project if I had a choice, and I would not pursue professional opportunities with legacy PHP codebases except in very special circumstances.
There's few programming environments I hated more viscerally than PHP. Yes, it got the job done. But thank God I never had to maintain that giant kludge of duct tape and elastic bands.
I think the allure of javascript is the idea that you can use sparse server resources and have your software mostly run on the client side.
I’m resistant to using php, because I really don’t want to have heavy server resources, but if I were building an app that used heavy server resources anyways, I would be open to php.
60 comments
[ 2.9 ms ] story [ 73.4 ms ] threadIt also includes breaking changes in point releases which is a nonsensical maintenance strategy - this is in stark contrast to the reputation of stability in a Corolla.
While PHP may have some strengths, it immediately fails this particular comparison.
As I remember it all the early languages that let you write code inline with the HTML were proprietary such as server-side Javascript built into Netscape's web server, ColdFusion, ASP, etc.
PHP was the first of these that was open source and basically competent which made it my #1 choice for making web applications in 2001. Compared to many other languages (say cgi-bin) it was pretty fast without a build step and had enough resource management that hosting firms could offer cheap PHP hosting plans which made world-changing open source products like Wordpress deployable.
It got long in the tooth quickly because people realized that to make quality web applications you had to have a part of your framework (a "router") which could serve different pages based on the inputs. For example, if you are doing server-side error handling on a form you either display a form that says "successful" or you re-display the form with error messages. You certainly can write PHP that does that if you have some discipline, but once you introduce a router you might as well write your "views" with some kind of templating system and after ruby-on-rails every language got frameworks, typically Sinatra-like, which were about as comfortable as PHP and that pushed you into having some discipline.
I also really don’t like the language. I’ve never warmed to it.
But I think it will still be around, as a principal backend language, for the next fifty years.
I feel like this graph says it all: https://w3techs.com/technologies/history_overview/programmin...
I call it "The Fishtank Graph," for obvious reasons.
I've never really used it but it would have been somewhat useful to know why anyone would choose this language for a greenfield project in 2025, given the choices available. The reasons given are pretty unconvincing to me.
PHP is the Hyundai Elantra of programming. It used to be popular because of low adoption costs but was the butt of jokes for a long time because of its questionable design and poor reliability. But like the Elantra, it has come a long way and is actually decent these days.
What does it do better than other languages? The article mentions features that sound like parity with other modern languages, but nothing that stands out.
Besides the shared nothing architecture mentioned by sibling:
- A more mature community and ecosystem for open source packages e.g. basics like following semver
- One single clear option for package management, which is also by far best in class
- Simply better performance except maybe compared to javascript
While the rest of the options may tick one of the above boxes, none of them ticks all 3.
I've written more shell scripts than any other language for close to a decade now. The reason is simple: I'm not writing web apps. I mostly do system programming (that is to say, tasks needed to build or maintain a system or are generally user-focused yet non-interactive). You don't need more than a shell script for most of that.
My contemporaries will, of course, pooh-pooh a shell script on general principle. If it's not using a more "advanced language" it must be unreliable or unmaintainable or ugly. Yet the practical experience of writing programs in multiple languages over years leads me to the same conclusion: literally any language will do. You could use BASIC for system programming. You could use ASM. It will work. People will argue over whether one language is "better" than another, but who cares if it's better or not? If it works it works. But that's because nearly any language works for that kind of program. Other kinds of programs need advanced features, so you need a more advanced language. But for simple tasks? It doesn't matter.
To go back to the car analogy: you can use literally any car to pick up groceries. You can't use any car to pick up 3,000lbs of sandbags.
If we were scientists and not craftspeople, none of these discussions would be relevant. We'd pick up the tool designed for our specific purpose and not bicker over our personal preferences or idealistic principles. But our languages, and our approach to using them, is anything but scientific. We're just a bunch of tradies talking shit at the water cooler.
https://www.youtube.com/watch?v=azEvfD4C6ow
https://en.wikipedia.org/wiki/Bagger_288
Basically what they did is they had repeated codemods (changes to the entire codebase with automated tooling) that bit by bit moved PHP closer to Java. More and more static typing, generics, all the common Java ADTs (Vector, Map, Set, Pair, etc.), bytecode+JIT execution, etc.
Essentially instead of rewriting the codebase to a better language they just changed the language itself. Which makes sense since PHP is a much smaller codebase than the Meta backend.
I think that’s the root of much of the horror. No one would bat an eye at using PHP to add little bits of server-side content here and there. It’s great for that! But then you see the giant castles of non-Euclidean horror built with it, and people pointing to them and saying “see what you can built with that weird screwdriver?”, and parts of the castles randomly fall off and kill their owners. No! While that’s impressive, it doesn’t exactly inspire confidence in the screwdriver, or in the people who keep using it to build things larger than it was clearly able to do well. But heaven help you if you point out that there are saner screwdrivers. “You’re just being close minded and out of touch! We added another handle to it and removed the razor blade so it’s much better now!”
Maybe so, but wow, it’s still one hell of an odd screwdriver.
I would say it was more like the bicycle. Cheap, no license, even a kid could be suddenly zooming around town with no ceremony, no red tape, minimal investment.
I haven't used it in well over a decade, but still remember fondly how great it was as a gateway drug to bigger and better things.
Thanks God most of us didn’t have to deal with that enterprise crap for long, and in my case it was thanks to PHP too.
It just moved the work somewhere else, generally an Apache config on a shared host. The user could very often just dump some PHP files in place and they'd be served up, but if you had to set up a new host then it was as fiddly as anything else.
This pattern also meant dropping everything the docroot, using .htaccess to hide things, having different behaviour depending on the global php.ini. All architectures had to be mashed into a request/response cycle (and anything more complex was no longer just drop the files in). It was a very long way from the idea of reproducable builds.
I agree it was popular, but not really for the right reasons.
PHP is boring and poorly designed. Maybe more like some of the very old Eastern European cars.
Generally - we live in a world with lots of fantastic programming languages, so I would never choose PHP for a greenfield project if I had a choice, and I would not pursue professional opportunities with legacy PHP codebases except in very special circumstances.
I’m resistant to using php, because I really don’t want to have heavy server resources, but if I were building an app that used heavy server resources anyways, I would be open to php.