Some schools have a combined residency/PhD program. The exact way this works varies, but a typical example is a 3-year residency during which you also take classes then additional 2 years or so to complete research and thesis.
The advantage of this is you complete both in less time compared to doing each separately. The main disadvantage is taking classes while you're on hospital duty.