PHP | ReflectionMethod getModifiers() Function Last Updated : 17 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionMethod::getModifiers() function is an inbuilt function in PHP which is used to return the numeric representation of the method modifiers. Syntax: int ReflectionMethod::getModifiers( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the numeric representation of the method modifiers. Below programs illustrate the ReflectionMethod::getModifiers() function in PHP: Program_1: php <?php // Initializing a user-defined class class Company { protected function GeeksforGeeks($name) { return 'GFG' . $name; } } // Using ReflectionMethod() over the class Company $A = new ReflectionMethod(new Company(), 'GeeksforGeeks'); // Calling the getModifiers() function $B = $A->getModifiers(); // Getting the numeric representation // of the method modifiers. var_dump($B); ?> Output: int(134283776) Program_2: php <?php // Initializing a user-defined class class Department { final public static function Coding() { return; } public function Marketing() { return; } } // Using ReflectionMethod() over the above class $A = new ReflectionMethod('Department', 'Coding'); $B = new ReflectionMethod('Department', 'Marketing'); // Calling the getModifiers() function and // getting the numeric representation // of the above method modifiers. var_dump($A->getModifiers()); var_dump($B->getModifiers()); ?> Output: int(134217989) int(134283520) Reference: https://www.php.net/manual/en/reflectionmethod.getmodifiers.php Comment More infoAdvertise with us Next Article PHP | ReflectionMethod getModifiers() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-function PHP- Reflection Similar Reads PHP | Reflection getModifiers() Function The Reflection::getModifiers() function is an inbuilt function in PHP which is used to return an array of the specified modifier names. Syntax: int Reflection::getModifiers( void ) Parameters: This function does not accept any parameters. Return Value: This function returns a bitfield of the access 2 min read PHP | Reflection getModifierNames() Function The Reflection::getModifierNames() function is an inbuilt function in PHP which is used to return an array of the specified modifier names. Syntax: array Reflection::getModifierNames( int $modifiers ) Parameters: This function accepts single parameter $modifiers which is Bitfield of the modifiers. H 2 min read PHP | ReflectionProperty getModifiers() Function The ReflectionProperty::getModifiers() function is an inbuilt function in PHP which is used to return the numeric representation of the specified modifiers. Syntax: int ReflectionProperty::getModifiers ( void ) Parameters: This function does not accept any parameters. Return Value: This function ret 2 min read PHP | ReflectionMethod getClosure() Function The ReflectionMethod::getClosure() function is an inbuilt function in PHP which is used to return a dynamically created closure for the method otherwise, return NULL in case of an error. Syntax: Closure ReflectionMethod::getClosure ( $object ) Parameters: This function accepts a parameter object whi 2 min read PHP | ReflectionMethod isFinal() Function The ReflectionMethod::isFinal() function is an inbuilt function in PHP which is used to return TRUE if the specified method is final, otherwise returns FALSE. Syntax: bool ReflectionMethod::isFinal( void ) Parameters: This function does not accept any parameters. Return Value: This function returns 2 min read Like