PHP | ReflectionClass implementsInterface() Function Last Updated : 11 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionClass::implementsInterface() function is an inbuilt function in PHP which is used to check the specified interface is present or not. Syntax: bool ReflectionClass::implementsInterface( string $interface ) Parameters: This function accepts a single parameter $interface which holds the specified interface which are being checked. Return Value: This function returns true on success or false on failure. Below programs illustrate the ReflectionClass::implementsInterface() function in PHP: Program 1: php <?php // Defining some interfaces interface Colleges { } interface Departments { } interface Students { } interface Companies { } // Initialising a class of Interfaces class Interfaces implements Colleges, Departments, Students, Companies { } // Using ReflectionClass over the class Interfaces $A = new ReflectionClass("Interfaces"); // Calling the implementsInterface() function // over the Interface 'Colleges' $B = $A->implementsInterface('Colleges'); // Getting the value true or false var_dump($B); ?> Output: bool(true) Program 2: php <?php // Defining a SuperClass interface Company interface Company { public function GFG(); } // Defining a different interface Company1 interface Company1 { public function GeeksforGeeks(); } // Defining a subclass Departments class Departments implements Company { public function GFG() {} } // Using ReflectionClass() over the // subclass Departments $reflect = new ReflectionClass('Departments'); // Calling implementsInterface() function $A = $reflect->implementsInterface('Company1'); // Getting the value either true or false var_dump($A); ?> Output: bool(false) Reference: https://www.php.net/manual/en/reflectionclass.implementsinterface.php Comment More infoAdvertise with us Next Article PHP | ReflectionClass implementsInterface() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-function PHP- ReflectionClass PHP- Reflection +1 More Similar Reads PHP | ReflectionClass isInterface() Function The ReflectionClass::isInterface() function is an inbuilt function in PHP which is used to check the specified class is an interface or not. Syntax: bool ReflectionClass::isInterface( void ) Parameters: This function does not accept any parameters. Return Value: This function returns TRUE if the spe 1 min read PHP | ReflectionClass getInterfaces() Function The ReflectionClass::getInterfaces() function is an inbuilt function in PHP which is used to return an associative array of interfaces. These returned array is containing keys as interface names and the array values as ReflectionClass objects. Syntax: array ReflectionClass::getInterfaces( void ) Par 2 min read PHP | ReflectionClass getInterfaceNames() Function The ReflectionClass::getInterfaceNames() function is an inbuilt function in PHP which is used to return an array of interface names as values. Syntax: array ReflectionClass::getInterfaceNames( void ) Parameters: This function does not accept any parameters. Return Value: This function returns an arr 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 isInternal() Function The ReflectionClass::isInternal() function is an inbuilt function in PHP which is used to check if class is defined internally by an extension, or the core. Syntax: bool ReflectionClass::isInternal( void ) Parameters: This function does not accept any parameters. Return Value: This function returns 1 min read PHP | ReflectionClass inNamespace() Function The ReflectionClass::inNamespace() function is an inbuilt function in PHP which is used to check the existence of the namespace. It returns true for the success or false on failure. Syntax: bool ReflectionClass::inNamespace( void ) Parameters: This function does not accept any parameters. Return Val 1 min read PHP | ReflectionClass isIterateable() Function The ReflectionClass::isIterateable() function is an inbuilt function in PHP which is used to check if the defined class is iterateable or not. Syntax: bool ReflectionClass::isIterateable() Parameters: This function does not accept any parameter. Return Value: This function returns TRUE if the define 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 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 PHP | ReflectionClass getExtensionName() Function The ReflectionClass::getExtensionName() function is an inbuilt function in PHP which is used to return the name of the extension which define the class or false for user-defined classes.Syntax: string ReflectionClass::getExtensionName( void ) Parameters: This function does not accept any parameters. 1 min read Like