PHP | Reflection getModifierNames() Function Last Updated : 23 Aug, 2021 Comments Improve Suggest changes Like Article Like Report 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. Here the bitfield is a data structure consisting of a number of adjacent computer memory locations.Return Value: This function returns an array of the specified modifier names.Below programs illustrate the Reflection::getModifierNames() function in PHP: Program 1: php <?php // Declaring a class Testing class Testing { // Calling a function GeeksforGeeks() with // two modifier named as public and static public static function GeeksforGeeks() { return; } } // ReflectionMethod is called on the class Testing and // their member as function GeeksforGeeks() $GeeksforGeeks = new ReflectionMethod('Testing', 'GeeksforGeeks'); // Calling the getModifierNames() function and printing // an array of modifier names echo implode(' ', Reflection::getModifierNames($GeeksforGeeks->getModifiers())); ?> Output: public static Program 2: php <?php // Declaring a class Testing class Testing { // Calling a function GFG() with // two modifier named as public and static final public function GFG() { return; } } // ReflectionMethod is called on the class Testing and // their member as function GFG() $GFG = new ReflectionMethod('Testing', 'GFG'); // Calling the getModifierNames() function and printing // an array of modifier names echo implode(' ', Reflection::getModifierNames($GFG->getModifiers())); ?> Output: final public Reference: https://www.php.net/manual/en/reflection.getmodifiernames.php Comment More infoAdvertise with us Next Article PHP | Reflection getModifierNames() 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 | ReflectionMethod getModifiers() Function 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 1 min read PHP | Reflection getShortName() Function The Reflection::getShortName() function is an inbuilt function in PHP which is used to return the short name of the specified class, the part without the namespace. Syntax: string Reflection::getShortName( void ) Parameters: This function does not accept any parameters. Return Value: This function r 1 min read PHP | Reflection getName() Function The Reflection::getName() function is an inbuilt function in PHP which is used to return the name of the specified class. Syntax: string Reflection::getName( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the name of the specified class. Below pr 1 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 Like