PHP | ReflectionProperty getModifiers() Function Last Updated : 30 Dec, 2019 Comments Improve Suggest changes Like Article Like Report 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 returns the numeric representation of the specified modifiers. Below programs illustrate the ReflectionProperty::getModifiers() function in PHP: Program 1: php <?php // Initializing a user-defined class Company class Company { public $SizeOfGeeksforGeeks = 13; protected $SizeOfGFG = 3; } // Using ReflectionProperty $A = new ReflectionProperty('Company', 'SizeOfGeeksforGeeks'); $B = new ReflectionProperty('Company', 'SizeOfGFG'); // Calling the getModifiers() function $C = $A->getModifiers(); $D = $B->getModifiers(); // Getting the numeric representation of // the specified modifiers. var_dump($C); var_dump($D); ?> Output: int(256) int(512) Program 2: php <?php // Initializing some user-defined classes class Department1 { protected $SizeOfHR = 2; } class Department2 { public $SizeOfCoding = 6; } class Department3 { private $SizeOfMarketing = 9; } // Using ReflectionProperty over above classes $A = new ReflectionProperty('Department1', 'SizeOfHR'); $B = new ReflectionProperty('Department2', 'SizeOfCoding'); $C = new ReflectionProperty('Department3', 'SizeOfMarketing'); // Calling the getModifiers() function $D = $A->getModifiers(); $E = $B->getModifiers(); $F = $C->getModifiers(); // Getting the numeric representation // of the specified modifiers. var_dump($D); var_dump($E); var_dump($F); ?> Output: int(512) int(256) int(1024) Reference: https://www.php.net/manual/en/reflectionproperty.getmodifiers.php Comment More infoAdvertise with us Next Article PHP | ReflectionProperty 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 | ReflectionProperty getName() Function The ReflectionProperty::getName() function is an inbuilt function in PHP which is used to return the name of the specified property. Syntax: string ReflectionProperty::getName ( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the name of the speci 1 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 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 getDeclaringClass() Function The ReflectionProperty::getDeclaringClass() function is an inbuilt function in PHP which is used to return the specified declaring classes. Syntax: ReflectionClass ReflectionProperty::getDeclaringClass ( void ) Parameters: This function does not accept any parameter. Return Value: This function retu 2 min read Like