Voting

: min(eight, eight)?
(Example: nine)

The Note You're Voting On

a dot cudbard-bell at sussex dot ac dot uk
16 years ago
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

<< Back to user notes page

To Top