A doctor is anybody with a doctorate.
Somehow, colloquially, we came to only refer to MD’s ( Doctor of Medicine ) as doctors.
A PhD is just a Doctor of Philosophy. A PhD doesn’t make anyone a doctor more so than an MD or a JD. Yes, even a lawyer is a doctor.
Anybody with a doctorate degree is a doctor. And just for fun, all a doctorate means is the highest degree awarded by a graduate school or other approved educational organization. Feel like I’m getting too technical with this so I’m just going to stop writing this comment.