This article describes how to obtain and check the class name, function name, and method name in php. This article summarizes the functions and usage of the seven functions, for more information, see 1. function_exists ()-Return TRUE if the given function has been defined
2. is_callable ()-check whether the parameter is a valid callable structure
3. class_exists ()-check whether the class has been defined
4. method_exists ()-check whether the method of the class exists
_ FUNCTION name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the function is defined ). In PHP 4, the value is always lowercase letters.
_ CLASS name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the class is defined ). In PHP 4, the value is always lowercase letters.
_ METHOD _ class METHOD name (new PHP 5.0.0 ). Returns the name (case sensitive) when the method is defined ).
Note: These constants have two underscores.
Get_class (class name); // Obtain the class name of the class where the current statement is located.
Get_class_methods (class name); // retrieves all the method names of the class name and forms an array
Get_class_vars (class name); // retrieves all the highlighted names of the class name and forms an array