3v4l.org

run code in 200+ php & hhvm versions
<?php class A {} class B extends A{} class C extends B{} $b = 'B'; var_dump(is_subclass_of('A', 'A'), is_subclass_of('B', 'A'), is_subclass_of($b, 'A')); var_dump(is_a('A', 'A', true), is_a('B', 'A', true), is_a($b, 'A', true)); $className = 'C'; while($_parentClass = get_parent_class($className)) $parentClass = $_parentClass; var_dump($className, $parentClass);