PHP | get_class_methods() Function Last Updated : 16 Apr, 2020 Comments Improve Suggest changes Like Article Like Report The get_class_methods() function is an inbuilt function in PHP which is used to get the class method names. Syntax: array get_class_methods( mixed $class_name ) Parameters: This function accepts a single parameter $class_name which holds the class name or an object instance. Return Value: This function returns an array of method names defined for the class on success and returns NULL in case of error. Below programs illustrate the get_class_methods() function in PHP: Program 1: php <?php // Create a class class GFG { public function Geeks() { var_dump(get_called_class()); } public function GeeksforGeeks() { var_dump(get_called_class()); } } $getClassMethod = get_class_methods('GFG'); foreach ($getClassMethod as $method) { echo "$method\n"; } ?> Output: Geeks GeeksforGeeks Program 2: php <?php // Create a class class GFG { public function Geeks() { var_dump(get_called_class()); } public function GeeksforGeeks() { var_dump(get_called_class()); } public function G4G() { // Empty method } } class_alias('GFG', 'GeeksforGeeks'); $getClassMethod = get_class_methods('GeeksforGeeks'); foreach ($getClassMethod as $method) { echo "$method\n"; } ?> Output: Geeks GeeksforGeeks G4G Reference: https://www.php.net/manual/en/function.get-class-methods.php Comment More infoAdvertise with us Next Article PHP | get_class_methods() Function A ashokjaiswal Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-OOP Similar Reads PHP | get_class() Function The get_class() function is an inbuilt function in PHP which is used to return the class name of an object. Syntax: string get_class( object $object ) Parameters: This function accepts single parameter $object which holds the object that need to be tested. The value of this parameter can be omitted 1 min read PHP method_exists() Function The method_exists() function is an inbuilt function in PHP which used to check the class method exists or not. It returns "true" if the method exists otherwise returns "false". Syntax: bool method_exists( object|string $object_or_class, string $method );Parameters: This function accepts two paramete 1 min read PHP class_parents() Function The class_parents() function is an inbuilt function in PHP where the parent class for the given class will be returned. Syntax: class_parents( object|string $object_or_class, bool $autoload = true ): array|false Parameters: This function accepts two parameters that are described below: object_or_cla 1 min read PHP get_class_vars() Function The get_class_vars() function is an inbuilt function in PHP which is used to get the default properties of a class. Syntax: array get_class_vars(string $class)Parameters: This function accepts one parameter that is described below: $class: This parameter specifies the name of the class.Return Value: 1 min read PHP | get_called_class() Function The get_called_class() function is an inbuilt function in PHP which is used to get the class name where the static method is called. Syntax: string get_called_class( void ) Parameters: This method does not accept any parameter. Return Value: This function returns the class name on success and return 1 min read PHP openssl_get_md_methods() Function The openssl_get_md_methods() function is an inbuilt function in PHP that is used to retrieve a list of available digest (message digest) methods supported by OpenSSL. Syntax: openssl_get_md_methods(bool $aliases = false): array Parameters: This function accepts one parameter which is described below 2 min read PHP | get_declared_classes() Function The get_declared_classes() function is an inbuilt function in PHP which is used to return an array with the name of the defined classes. The user array containing the list of all the system-defined(for example, PDO, XML reader, etc) and user-defined classes in the present script. No parameters are g 1 min read PHP class_uses() Function The class_uses() function is an inbuilt function in PHP where the traits utilized by the given class, will be returned. Syntax: class_uses($object_or_class,$autoload = true): array|false Parameters: This function accepts the two parameters that are described below object_or_class: The name of the cl 2 min read PHP | is_a() function The is_a() is a built-in function in PHP and is used to check whether a given object is of a given class or not. It also checks if the given class is one of the parents of the given object or not. Syntax: boolean is_a($object, $class) Parameters: This function accepts two parameters as shown in the 2 min read 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 Like