> Developers hate PHP because you are more likely to get errors with a language that allows so much freedom.
Ruby gives you much more freedom than PHP. You can reopen classes, you can use any kind of object as a key in an associative array, you can write code that will execute when the class (not the instance) is being created. And yet I find it much easier to write stable code in Ruby.
> Developers hate PHP because it is the opposite of hype driven development
Does C# gets so much hate? Or Python? I don't think either of them is an example of hype driven development, and yet they are rather respected languages that don't get so much hate.
> Developers hate PHP because they believe the language has been stagnating for 20 years.
Again, I don't think that's it. I've been using PHP7 for the last few months and yes, it is different from PHP4. You have optional static typing, you have better tools, a lot has changed. Yet deep in its core the language is still badly designed. I constantly find some weird behaviours that just don't exist in other languages.
Example:
$array = [1,2,3,4]
array_filter($array, function($x) { return $x %2 === 0; });
In every other language I've used, such function would return [2,4], but not in PHP.
array_merge(
[ "a" => "w", "1" => "x" ],
[ "a" => "y", "1" => "z" ]
)
In every other language I know, it would return [ "a" => "y", "1" => "z" ], but PHP returns [ "a" => "y", 0 => "x", 1 => "z" ]
I know, these are just random examples and every language has its quirks. The problem is that in PHP there are so many quirks I keep checking how each function works, because after half a year I still can't remember them (and I don't remember whether array is a first or a second argument, because it depends on a function).
I wouldn't say that I hate PHP. It's another tool that I know and am able to use. I just think in 2020 in most cases when you start writing a new web application, there are plenty of better options. So maybe that's where the hate comes from? That there are simply many more consistent languages that just remain less popular than PHP?