PHP | ReflectionClass isSubclassOf() Function Last Updated : 05 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionClass::isSubclassOf() function is an inbuilt function in PHP which is used to check if any subclass is available or not. Syntax: bool ReflectionClass::isSubclassOf( $class ) Parameters: This function accepts a single parameter class which is the class name being checked against. Return Value: This function returns TRUE if the subclass is available, otherwise FALSE. Below programs illustrate the ReflectionClass::isSubclassOf() function in PHP: Program 1: php <?php // Initialising a user-defined superclass Company class Company { public function GeeksforGeeks() {} } // Creating a subclass Departments class Departments extends Company { public function HR_Department() {} } // Using ReflectionClass() $subclass = new ReflectionClass('Departments'); // Calling the isSubclassOf() function $Result = $subclass->isSubclassOf('Company'); // Getting the value true or false var_dump($Result); ?> Output: bool(true) Program 2: php <?php // Initialising a user-defined class Departments class Departments { public function CSE() {} } // Using ReflectionClass() over the // user-defined class Departments $subclass = new ReflectionClass('Departments'); // Calling the isSubclassOf() function $Result = $subclass->isSubclassOf('Departments'); // Getting the value true or false var_dump($Result); ?> Output: bool(false) Reference: https://www.php.net/manual/en/reflectionclass.issubclassof.php Comment More infoAdvertise with us Next Article PHP | ReflectionClass isSubclassOf() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-function PHP- ReflectionClass PHP- Reflection +1 More Similar Reads PHP | ReflectionClass isCloneable() Function The ReflectionClass::isCloneable() function is an inbuilt function in PHP which is used to check the specified class is cloneable or not. Syntax: bool ReflectionClass::isCloneable( void ) Parameters: This function does not accept any parameters. Return Value: This function returns True if class is c 1 min read PHP | ReflectionClass isFinal() Function The ReflectionClass::isFinal() function is an inbuilt function in PHP which is used to check the specified class is final or not. Syntax: bool ReflectionClass::isFinal( void ) Parameters: This function does not accept any parameters. Return Value: This function returns true for the success or false 1 min read PHP | ReflectionClass isInstance() Function The ReflectionClass::isInstance() function is an inbuilt function in PHP which is used to check whether the specified object is an instance of the class or not. Syntax: bool ReflectionClass::isInstance( object $object ) Parameters: This function accepts a single parameter object which is being searc 1 min read PHP | ReflectionClass isUserDefined() Function The ReflectionClass::isUserDefined() function is an inbuilt function in PHP which is used to check if any user-defined class is available or not.Syntax: bool ReflectionClass::isUserDefined() Parameters: This function does not accept any parameter.Return Value: This function returns TRUE if the user- 1 min read PHP | ReflectionClass isAbstract() Function The ReflectionClass::isAbstract() function is an inbuilt function in PHP which is used to check the specified class is abstract or not. Syntax: bool ReflectionClass::isAbstract( void ) Parameters: This function does not accept any parameters. Return Value: This function returns true for the success 1 min read Like