I have a class which I need to use to extend different classes (up to hundreds) depending on criteria. Is there a way in PHP to extend a class by a dynamic class name?
Yes. I like the answer with eval, but a lot of people afraid of any eval in their code, so here's one with no eval: