Exactly this. If you already know PHP and can produce results (mostly CRUD apps) and it doesn't need millions of rps, why do we need to use another language because they are so much better ? So much better at what ? It is like saying "I have a hammer, so everything looks like a nail to me". Not every web app has to be written in Lua/Rust/Go/Julia etc. Each language comes at a cost. No free lunch.
"But why should anyone start a new project in php now that we have so many good alternatives?"
Because everything comes at a cost. You want to use Rust instead of PHP ? Sure, sounds great. Now lets go find a really good Rust developer who also understands how to host it correctly and then if he leaves, can I easily find another Rust developer ? Hmmm. You also need to account for maturity, ecosytem, hosting, maintenance etc which are all real world problems. Building a new shiny toy project ? Go ahead use whatever language you love. Again, it is about cost vs benefit.
I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP.
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
edit: Flickr user @raindrift made an actual PHP hammer, famously https://www.flickr.com/photos/nicoletbn/6949293600
2012 discussion of hammer https://news.ycombinator.com/item?id=3866488
TechCrunch defence of the hammer https://techcrunch.com/2012/07/28/not-that-kind-of-filthy-ge...
A more reasonable analogy would be that there's a standardized toolbox that carpenters use that's weird, quirky and sometimes so bad that you need to know workarounds to use it correctly, but the houses that are being built do what they're supposed to in the vast majority of cases because most of the carpenters know the quirks well.
The question then is, if you're contracting someone to build your house, or you're the manager of a construction company, do you go with the standard toolbox that's used by the X% majority of carpenters, or do you hire carpenters that use more obscure (but functionally "better") toolboxes while running the risk of now ending up with unmaintainable or deviating houses that are hard to recruit additional carpenters for because they refuse to work on what is quite objectively "non-standard" houses?
The answer in my mind is no less complex than it would be for software development: it depends, and you should be wary of anyone telling you that it's "obvious" that the answer is one or the other.
But there are modern carpenters that have hammers that are 100% metal and never break and actually improve your hammering power. The new electric hand planes work a lot faster, though you do have to be more careful because they can get out of hand quicker. etc etc.
In the end, they both build houses. The old-school carpenters might take longer, and they might have to know more techniques, but they get there in the end.
On the other hand, the modern carpenters sometimes go a littler overboard with their tools and have problems that old-school carpenters don't have, especially with their tools randomly stopping working in the middle of a job. It might not be often, but it happens.
To add to that, the old-school carpenters can actually use a lot of the new tools, too. They fit into the workflow and can be adapted to their old tools. It's just that they primarily stick with their old tools because they're used to them.
It's kind of interesting how much the world of woodworking and software development overlaps in that way.
Great extra point. I'm often surprised at how much random breakage other people just accept as normal in "modern" webdev (meaning, for better or worse, you're involving javascript somewhere in the process). Put another way, I'm frustrated by how much I'm expected to just 'deal with' because a seeming large number of other people don't see a problem with it (or don't see enough of a problem with it).
Those old tools still worked, just not as well as modern versions.
Rasmus Lerdoff actually gave a great talk on why he created PHP and how it sort of accidentally turned into a programming language: https://www.youtube.com/watch?v=nmD1Q4FsXCc
Yes, it has quirks -- so does C, so does C#, so does JS, so does lua, so does tcl, so does every assembly language I've ever worked with.
So what? Are those preventing people from writing good code? Are those preventing people from shipping? Could it be improved? Has it already been improved? No, no, yes, and yes.
The biggest reason PHP's gotten so much scrutiny, to where people write these kinds of posts, is its ubiquity. When JS moved from being that simple, silly language built into the browser into a widely used one, we started seeing slide deck gags about the inscrutability of its comparison operators, yet JS seldom attracts this level of derision.
I don't believe the constraint would be the language itself, not with accellerators, opcode caches, JIT compilers, etc. I've always been told that PHP's performance is more down to the database than anything else.
I don't know where you pulled that number out of, but I just used an outdated version of `ab` to request the Hello World page of a fairly heavy PHP framework on a modest virtual server and got over 4k rps. Give me a proper server box and a well-written application, and I'll deliver the 25k rps that you want.
Besides, most webapps spend most of their execution time waiting for the database, memcached, redis, elasticsearch, or whatever. The speed of the language runtime makes very little difference.
Absolutely not, you could already go to 5k rps 10 years ago and PHP has massively improved since.
There will always be something negative regardless of what you pick, problem is to decide what your core values are when writing different types of software. If you don't, you are just comparing apples to oranges.
When it comes to PHP, core values are usually things that has to do with tooling, server architecture & deployment, not much the language (syntax, expressions, lambdas, classes etc) it self, except maybe it is easy to learn & use.
This means that developers who comes from a background of that the language itself is the most important part of a project will most of the time just get confused what PHP is about.