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 PHP | ReflectionClass getProperty() Function The ReflectionClass::getProperty() function is an inbuilt function in PHP which is used to return an array of the ReflectionProperty for the specified class. Syntax: ReflectionClass::getProperty ( string $name ) : array Parameters: This function accepts a parameter name which is name of the property 1 min read PHP | ReflectionClass getFileName() Function The ReflectionClass::getFileName() function is an inbuilt function in PHP which is used to return the filename of the file in which the class has been defined or returns false if the file is not found. Syntax: string ReflectionClass::getFileName( void ) Parameters: This function does not accept any 1 min read PHP | ReflectionClass getConstant() Function The ReflectionClass::getConstant() function is an inbuilt function in PHP which is used to return the value of the defined constant. Syntax: mixed ReflectionClass::getConstant( string $name ) Parameters: This function accepts a parameter Name which is the name of the defined constant. Return Value: 1 min read PHP | ReflectionClass getProperties() Function The ReflectionClass::getProperties() function is an inbuilt function in PHP which is used to return an array of the reflected properties. Syntax: ReflectionClass::getProperties($filter) : array Parameters: This function accepts a parameter filter which helps to remove some of the reflected propertie 2 min read PHP | ReflectionClass getTraitNames() Function The ReflectionClass::getTraitNames() function is an inbuilt function in PHP which is used to return an array of name of traits used by the user-defined class. Syntax: array ReflectionClass::getTraitNames( void ) Parameters: This function does not accept any parameters. Return Value: This function re 1 min read Like