I wouldn't consider Yahoo the pinacle of software engineering, or a hotbed for inovation. For a company of their size, they are not releasing any groundbreaking features, or anything too advanced, and they are obviously trailing google by a big margin.
Facebook and Digg are two other notable mention of php usage. Both are handling very high traffic loads ok (not spectacular), and I know that facebook is using a lot of C/C++ and some Java on the backend. The main reason that they are php is b/c it was the better choice for the founders, to do something quick at the time (2004-2005).
Ruby on Rails was not even out, and Python didn't have great and simple frameworks with simple learning curve.
So, at the time the two sensible choices were Java or. Php. A great question would be: If facebook or digg had to redo everything from the beginning, would have still chosen php?