views:

37

answers:

1

Is it possible to get all subclasses of given class in php?

+1  A: 
function getSubclassesOf($parent) {
    $result = array();
    foreach (get_declared_classes() as $class) {
        if (is_subclass_of($class, $parent))
            $result[] = $class;
    }
}

Coincidentally, this implementation is exactly the one given in the question linked to by Vadim.

Artefacto