For a long time I have seen that the developers around me hate PHP, and I still do not understand why this happens.
I don't like some PHP stuff, but that does not mean it's a bad programming language ... I think every programming language has its own purpose, so instead of starting to complain about "why PHP does not work for me " I think we should spend more time comparing different programming languages and choose the one that achieves the goal of your project.
What is your opinion?

Latest comments (37)
I would like to contrast your opinion that you choose the programming language that achieves the goal of your project with that of the Elm programming language. A big part of the philosophy of Elm is to bring joy to the programmer. If you look at the Elm home page the tag-line says, "A delightful language for reliable web applications." Programming languages don't have to be unpleasant, but sometimes ... it is what it is.
The thing I hate about PHP is the $ sign to declare variables :), also naming inconsistency is another reason.
Well, one of the reasons that I do not prefer to use php or even touch it these days is that it allows you to organize your project the way you want. In other words, there is no organizational pattern to it like ASP MVC or Django or Flask.
This kind of freedome that php provides makes it easier for beginners to start learning and make projects as they like, but later as projects get bigger, and more developers contribute to them, it gets harder to understand what is going on.
Now there are frameworks that somewhat provide MVC pattern to php. Rasmus Lerdorf, the man who created php, described them in one of his workshops as "they all suck".
I actually used php for a while, but later as I learned how to use the MVC pattern on ASP and in python, I made the switch and never looked back.
I love php! It always worked well for me!! ❤️
I want to point out, that many of the hating people got to know PHP sometime in the mid 2000-s, when it slow, poorly designed procedural language with no real company or driving force behind it. It didn't have any coding standards nor real OOP support. It lacked a lot of features that every decent programming languages have. It was vulnerable to SQL injections and XSS attacks. Tutorials supported bad practices and had no consistence at all.
Now PHP's a completely different language. It's got great object oriented support, allowing you to use classes, traits and interfaces, static methods and many more. There are a lot of design patterns commonly used by many MVC frameworks making web development a breeze. When you use modern mainstream framework like Laravel, it feels almost like RoR and it's surely feels better than Django to me.
ORM, ActiveRecord, Composer package manager, lots of great Symfony bundles - all these makes writing performant PHP solution with ease. PHP-FIG delivers coding standards that make our code look consistent. The performance of PHP 7 almost equals Java's one in single threaded cases making it unbeaten among interpreted languages.
I fucking hate that i have to type $ every time write an identifier name, other then that it's fucking amazing and does it's specific job like no other
back in my old day people still mix php with html template hahaha,,
If someday you start doing frontend then never ever use REACT because it mixes javascript with same html
When I asked this same question to a boss of mine, he brought up the fact that our company has made 100s of millions of dollars off of PHP. I never questioned PHP again!
Even if PHP have several problems (random parameters order, loosely-typed, etc), it's the best language for the web. Without any PHP framework, you can render html page and all functions and classes are web-friendly. Try to do queries to Mysql database, encode datas to Json or submit a form in a browser with any other language, you will understand that I say.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.