Debug class inheritance

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.

כתיבת תגובה

האימייל שלך לא יוצג באתר. (*) שדות חובה מסומנים

*

תגי HTML מותרים: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">