At least in the US, I'm pretty sure the average age of a PhD (at least in the sciences) is closer to 27 than 34. 27 = 18 + 4 years undergrad + 5 years grad school.
The problem with that is all the outliers. Such as my mom just finished her second PHD at 58. Also, lot's of people only finish their dissertation at the 10 year deadline before they need to take more classes.
Exactly, 27 is sort of the practical lower bound, and probably a median. I believe very few people complete a PhD before 27, but many complete one after. Years in industry, years off, taking an extra year here or there, it adds up. This means the average will be significantly higher than the "optimal" or even "median" solution.
Actually, it's not that remarkable to have a PhD by 24 in the UK. Our university system's much more intensive than the American one; three years to your bachelors', three years of flat-out research for the PhD. (We don't do quals.)
I was slower; I was 26, which was pretty typical. Four year undergrad because I did a Masters, four year PhD because I overran a bit and started my postdoc before I'd finished writing up.
UK PhD's are not as intensive or valuable as American PhD's. The lack of a qualifier and the relatively lax criteria on which a PhD is awarded are two reasons for this.