I think it varies a lot. In my PhD program I am not required to take a single class. Suggested to. You'll fail your quals if you don't, suggested to. But not required at all.
Interesting. If you don't mind my asking, where are you going? For all the schools I applied to, it appeared that the PhD programs required taking classes.
The situation is very analogous to undergraduate with advanced placement (AP) courses.
Any university is going to require you to get credit for, e.g., some introductory computer science sequence (CS1, CS2) to get a bachelors in CS. However, universities vary a great deal in whether they (a) require a particular AP score, (b) require you to take a local test to prove your knowledge, or (c) whether you can just talk to someone and convince them you know the material.
The difference at the PhD level is that in many cases, incoming students have the equivalent of ten undergraduate and graduate courses in the sub-area, rather than one or two. This means that students at less curriculum-oriented universities can largely avoid taking classes, even though classes are "required." People are mostly fine with this because the thesis is usually a much higher bar than core curriculum competency anyway.