It can. It pretty much is.
https://wordpress.com/notable-users/
50%~ world's websites are on it, including 30% of world's ecommerce sites. If CNN, Reuters are not 'enterprise' enough, one wonders what is.
"These people often make codes based on cake recipes without understanding what they are doing."
That just sounds like unfounded, unproductive elitism.
has security flaws and is invaded and used for years without the person realizing it is done in PHP, whether using pure PHP, Laravel, WordPress, or other tools. It’s a monstrosity that happens.
When the 'real programming languages' that you speak of start running 50%~ of all websites on the Internet, with infinite extensibility, accommodating every single use case, revisit that statement again.
"All the technical points"
There isnt one single language that cannot be taken apart and criticized like this. Except only one of those languages is running ~50% of the Internet.
And there's the catch.
Its all fine and dandy when the language, protocol, standard you prefer is running in its own specific domain, handling a certain amount of use cases and running a small part of the digitized world. Everything can be very 'orderly' and 'secure'.
Its a whole another thing when that language becomes de facto infrastructure of the Internet and everyone uses it to do everything.
Which is what people want and need.
Nobody has the time to stop and pick different technology stacks and languages for every other use case to extract some 20%~ performance that they absolutely don't need, or to have a 'better' way of doing something in particular in theiw workflow.
They use what works. And obviously, PHP works.
Will it have problems with this or that particular use case?
Sure. Like it did with a lot of different things before.
But the community will sort them out and certain standards and usage patterns will emerge, empowering that particular field of activity/business. Just like how it has been up until this point. And millions of people will be able to do things that they were not able to do before.
But people will keep hating. Because, hating the mainstream is 'good'. Thats how we communicate to the public that we have more refined tastes for our stack preferences.