You hear it all the time - "PHP is dead", "PHP is spaghetti code", so on and so on, but is that really the case?
I'm a PHP developer, who's dabbled in some backend JS too, and I try to be impartial as possible.
No. The short answer is no. PHP is alive and kicking. Does that mean you should flock to it for all projects? Again, no. Should you instantly dismiss the language? No.
No no no.
In late 2020, PHP 8 was publicly birthed into the world, packed full of enhancements, features, improvements, and life. I get it, I truly do - older PHP was... or could be... unfortunate... we'll say. Having inherited 8-year-old codebases originally build on PHP 5.x, I know just how messy PHP can and does get - heck, even modern PHP can be written badly, but isn't that the case for near all languages?
Near every language, sure, more commonly interpreted languages have room for messy code, but that doesn't mean the language itself is bad. Modern PHP can be elegant, scalable and efficient, and that's without much effort.
Let's think - PHP is very much in active development. There's many, many CMS' based on PHP, and many great frameworks, too. One of the world's most popular frameworks - Laravel, is based on PHP. The world's most popular CMS - WordPress, is based on PHP. The PHP community is growing, and so is the quality of code.
This doesn't mean you should swear by the language for every use-case. Sockets? Sure, PHP can do it, but should you? Are there better tools out there? Definitely.
I think the problem with PHP is the low-entry barrier. PHP is great at making code just "work", which means you can, and do see a lot of poor code. That isn't always a bad thing, though. Everyone starts somewhere, right? And with the gigantic community, it's so so easy to learn and grow, which is incredible.
This post is just me spewing my views. I think it's important to remain logical and to use the best languages and tools for the solution to problems. That language might be PHP, and if it is, you can write some incredible code with it - if it isn't? Great, you can do just that with any other language too.
I'm very keen to hear thoughts on this topic - please do share yours :)