To answer that question in short, yes, PHP is still a very good when it comes to back-end programming languages.
Powering the web since a long time
Now when I am not self certifying myself as a PHP master but I have used PHP for a long time now and I know developers that have used PHP for more than a decade or two now.
One thing I have learned from them is that PHP never goes out of trend. You’ll see tons of different languages and tools coming into the market every year and since it’s a new “cool” thing, every kid on the street talks about it! In those heavy social media posts and blog talks, you might doubt the power of PHP or even Java.
It’s painful, stressful and disappointing for the current PHP developers and the developers who want to learn PHP to see the crap out there on social media and on many blogs about the fall of PHP and whether PHP is dead or not.
There are tons of options nowadays and many of them are added in the last decade or so. Some of those options are certainly good at performing some tasks but PHP powers a huge chunk of web apps in the world and it has done so for more than 2 decades now.
Powering more than 40% of the websites
PHP has a solution for a database connectivity as well as it powers an ecommerce website with a large number of products. Facebook was initially developed in PHP and still it uses PHP but compiles the code into into native code on its web servers. WordPress powers more than 40% of the websites and most of its code is in PHP.
NodeJS is very appealing alternative when it comes to back-end development but PHP’s support for transactional database applications is very superior.
PHP is still evolving and gets regular updates and new versions regularly thanks for the dedicated team of theirs.
I can’t promise anything about what future holds for PHP but the stats suggest that it’s going to stay in the web development market for a long time and will be a very good back-end language for a while.
Readability issue
The major issue with PHP code that newbie developers complain about is the code readability. Since PHP is embedded in HTML and HTML and scripts can be added using PHP, it makes hard to read the code if not formatted properly.
To solve that, you can use template systems in PHP and include small chunks of reusable code files. You can also use a nice code editor with PHP code formatting functionality in built. Try to add as many comments as possible to make the code understandable by any person on your team.
Learning takes time
PHP is not a language that you can learn in a week. You can learn few syntaxes and maybe creating a few web pages with a database connectivity using a YouTube video but to get a complete grasp on PHP, it takes a bit more time. Especially when you already know NodeJS, you might find the process cumbersome. But once you get the grasp, you can create a very powerful backend and then connect that backend with your choice of front-end language.
PHP 7 is faster and they just released PHP 8 few months back.
This article is not enough to write a many many advantages of using PHP as a back-end language. I hope this post at least gave you some insights on the larger question regarding PHP as a back-end language.
advantages back-end disadvantages server