Here's a simple way of getting the inheritance tree of a class, no matter which class the function was actually defined in. Will work as a static function method too.
<?php
class A {
public function get_class_tree(){
$cur_class = get_called_class();
do {
echo $cur_class;
}
while($cur_class = get_parent_class($cur_class));
}
}
class B {
}
class C {
}
$foo = new C();
$foo->get_class_tree();
?>
CBA