PHP | Reflection getShortName() Function Last Updated : 17 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 returns the short name of the specified class, the part without the namespace. Below programs illustrate the Reflection::getShortName() function in PHP: Program 1: php <?php // Defining a namespace and class GFG namespace A\B; class GFG{ } // Using ReflectionClass over the namespace and // specified class GFG $ReflectionClass = new \ReflectionClass('A\\B\\GFG'); // Calling getShortName() function $A = $ReflectionClass->getShortName(); // Getting the short name of the specified class var_dump($A); ?> Output: string(3) "GFG" Program 2: php <?php // Using ReflectionClass inbuilt function $ReflectionClass = new ReflectionClass('ReflectionClass'); // Calling getShortName() functions $A = $ReflectionClass->getShortName(); // Getting the short name of the specified class var_dump($A); ?> Output: string(15) "ReflectionClass" Reference: https://www.php.net/manual/en/reflectionclass.getshortname.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- ReflectionClass Similar Reads 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 | 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 | ReflectionClass getTraitNames() Function The ReflectionClass::getTraitNames() function is an inbuilt function in PHP which is used to return an array of name of traits used by the user-defined class. Syntax: array ReflectionClass::getTraitNames( void ) Parameters: This function does not accept any parameters. Return Value: This function re 1 min read PHP | Reflection getNamespaceName() Function The Reflection::getNamespaceName() function is an inbuilt function in PHP which is used to return the name of the specified namespace. Syntax: string Reflection::getNamespaceName( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the name of the spe 1 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 | ReflectionClass getStartLine() Function The ReflectionClass::getStartLine() function is an inbuilt function in PHP which is used to return the line number from where the user defined class get started. Syntax: int ReflectionClass::getStartLine( void ) Parameters: This function does not accept any parameters. Return Value: This function re 1 min read Like