If you've done the hard yards and have the experience to know What Not To Do, then PHP is quite good and you can push it a long long way in most directions before you start hitting boundaries. If you don't have the experience to build library layers, then PHP makes it awfully easy to shoot yourself in the foot. To which the only solution is usually quite extensive re-factoring.

However, that's not a criticism peculiar to PHP. Any full-featured, orthogonal language you could setup for web-programming will have that problem. Like C, it doesn't have any native structures to make you program better.

Wade.