class A {}
class B {}
class C extends B {}
$obj=new ReflectionClass('C');
var_dump($obj->isSubclassOf ('A')); //boolean false
var_dump($obj->isSubclassOf ('B')); //boolean true
(PHP 5, PHP 7)
ReflectionClass::isSubclassOf — Checks if a subclass
$class
)Checks if the class is a subclass of a specified class or implements a specified interface.
class
The class name being checked against.
Returns TRUE
on success or FALSE
on failure.
class A {}
class B {}
class C extends B {}
$obj=new ReflectionClass('C');
var_dump($obj->isSubclassOf ('A')); //boolean false
var_dump($obj->isSubclassOf ('B')); //boolean true