The trick is being aware of the pitfalls. Just because an application is written in PHP does not make it inherently bad, just as an application written in (e.g.) Rust does not make it inherently good.
One requires that you think a certain way in order to function at all. The other requires only that you can solve problems, but makes no guarantees that your solution will be the optimal one.
Regardless of language, the criteria you need to keep in mind is this:
> Am I solving a problem for people in a way that is better than other available solutions?
That's a feature in my eyes. Languages with too much freedom -- C++, PHP, Javascript and many others -- suffer from (a) lack of idiomatic syntax or ways of doing basic things like map&reduce; even finding an element in a list, or formating a date/time have many library choices, and (b) give you plenty of ways to shoot yourself in the foot.
Opinionated tech is a protection against a class of brain defects of the human programmers. You cannot keep track of 50+ potential dangers in your head all the time. You will inevitably make a mistake. Opinionated tech reduces the count of things you have to constantly be aware of.
So again, feature, not a bug.
If you must rag on PHP, presumably after some contemplation of the beam in your own eye, then this would be best accomplished by a more neutral and factual presentation, such as phpsadness.com. Spreading an angry, dismissive, fact-light rant is just poo-flinging.
E.g. I found myself regretting writing a 20k LOC hobby product in python, it rapidly became so much more of a hairball to grow than a strongly typed or statically compiled language (and part of me wonders how much that's because I haven't learned type hints yet); however you'll pry python from my cold dead hands before I take another language for data analysis/prototyping.
- Too dynamic: deliberately hand-wavy but, as you said things quickly become a hairball. No where I've been has been disciplined enough to keep Python projects clean, but they shouldn't have to be. - Dependency management: pipenv has made fetching dependencies a bit better, but it's so slow that it's almost unbearable to use (for even a small repo it has to download and execute setup.py from deps one at a time because the underlying system doesn't provide a decent way to calculate a dependency graph up front, it's aweful). - Testing: I don't know why exactly, but every single place I've ever been has had large chunks of tests that do nothing because mocks accidentally got substituted in for the thing being tested. Maybe this is just part of "too dynamic". - Deploys: I miss the days of single binaries. Workarounds like using containers just for the sake of having a single artifact that can be pushed to prod are solutions for a problem that shouldn't exist. That being said, single binaries seem to be in vogue again, so maybe those days will come again soon. There are certainly worse things here than Python, but still, it's been a major pain point at all places I've been previously. - Significant whitespace: I know this one is controversial and in theory is just a minor annoyance, but again, everywhere I've ever been we've had some sort of major issue where it turned out that something wasn't indented as much as someone thought it was and it was missed in code review. Curly braces may be ugly, but at least they're explicit. - The Python 2/3 split. 'nuf said. People acknowledge that this was a mistake, everyone else learned from it and it's becoming less of a problem over time (but not quick enough).
No language is perfect, but I can't think of a single problem that I wouldn't pick something else over (unless its a choice between Python and PHP, then I'll take PHP any day).
On a more positive note, I always miss context managers when working in other languages that don't have a similar concept.
EDIT: Sorry about the list formatting.
I've found developing PHP7 applications relatively easy and stress free with the combination of static analysis tools & PHP7 typehinting.
(They don't write C++ code, they still write PHP)