PHP | ReflectionClass getMethod() Function Last Updated : 17 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionClass::getMethod() function is an inbuilt function in PHP which is used to return a ReflectionMethod for the specified class method. Syntax: ReflectionMethod ReflectionClass::getMethod ( string $name ) Parameters: This function accepts a parameter $name which is the method name. Return Value: This function returns a ReflectionMethod for the specified class method. Below program illustrate the ReflectionClass::getMethod() function in PHP: php <?php // Using ReflectionClass over the inbuilt class // 'ReflectionClass' $class = new ReflectionClass('ReflectionClass'); // Calling the getMethod over the method named // as 'getMethod' $method = $class->getMethod('getMethod'); // Getting the ReflectionMethod for the specified // inbuilt class method. var_dump($method); ?> Output: object(ReflectionMethod)#2 (2) { ["name"]=> string(9) "getMethod" ["class"]=> string(15) "ReflectionClass" } Reference: https://www.php.net/manual/en/reflectionclass.getmethod.php Comment More infoAdvertise with us Next Article PHP | ReflectionClass getMethod() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-function PHP- ReflectionClass Similar Reads PHP ReflectionClass getMethods() Function The ReflectionClass::getMethods() function is an inbuilt function in PHP which is used to return an array of specified methods.Syntax: array ReflectionClass::getMethods( int $filter )Parameters: This function accepts a single parameter filter which is used to remove some of the methods.Return Value: 2 min read PHP | ReflectionClass hasMethod() Function The ReflectionClass::hasMethod() function is an inbuilt function in PHP which is used to check the specified method is present or not.Syntax: bool ReflectionClass::hasMethod( string $name ) Parameters: This function accepts a single parameter $name which holds the name of the method which are being 1 min read PHP | ReflectionClass getExtension() Function The ReflectionClass::getExtension() function is an inbuilt function in PHP which is used to return the ReflectionExtension object which represents the extension for the defined class, or NULL for the user-defined classes. Syntax: ReflectionExtension ReflectionClass::getExtension( void ) Parameters: 1 min read PHP | ReflectionClass getEndLine() Function The ReflectionClass::getEndLine() function is an inbuilt function in PHP which is used to return the line number where the user defined class get ends. Syntax: int ReflectionClass::getEndLine( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the li 1 min read PHP | ReflectionClass getDocComment() Function The ReflectionClass::getDocComment() function is an inbuilt function in PHP which is used to return the specified doc comments if it exists, otherwise returns false. Syntax: string ReflectionClass::getDocComment( void ) Parameters: This function does not accept any parameters.Return Value: This func 1 min read Like