well, some people would argue javascript is [still] a mess. Douglas Crockford has spent a career pointing out a lot of the weak spots (while still loving the language mind you). PHP started out as a non-serious project, and today it's had some serious problems (multi-threading to name one).
However, on the other hand, there are also projects that start out as non-serious and get serious quick - the Linux kernel comes to mind.
I guess it can go two ways, but I'd contend a project that is started out with short-cuts because the author doesn't anticipate or plan for it to scale, will have a much tougher time doing so.
This isn't a problem in 5.5+ if you know what you're doing. That the language has a lot of people with no idea what they're doing is a testament to the fact PHP is easy to use and most others aren't for a novice, not that the language sucks.
I'm not the biggest PHP fan but since 5.3 most of the criticisms are unwarranted.
Eventually if people like the core idea, these things enter a positive feedback loop and the quality goes up. If nobody likes it or uses it...no harm.
[1] https://www.w3.org/community/webed/wiki/A_Short_History_of_J...