Print
Hits: 5819

Function I wrote that can debug inheritance of object in PHP:

function debug_class_inherit($obj) {
$parent_class_name =  get_parent_class($obj);
if ($parent_class_name) {
debug_class_inherit($parent_class_name);
}
echo get_class($obj);
}

get_parent_class function return FALSE when no parent to the object.

Leave your comments

0
  • No comments found
Powered by Komento