Search Results
Preface Function Reference Variable and Type Related Extensions Reflection ReflectionClass Change language:
- getMethod
ReflectionClass::getMethod (PHP 5, PHP 7, PHP 8)...
- getProperties
Changelog ¶ ... Examples ¶ Example #1...
- getProperty
Gets a ReflectionProperty for a class's property Accessing...
- hasMethod
ReflectionClass::hasMethod (PHP 5 >= 5.1.2, PHP 7, PHP 8)...
- getDocComment
Note that \ReflectionClass::getDocComment() ignores all...
- isSubclassOf
See Also ¶ ReflectionClass::isInterface () - Checks if the...
- getConstants
Parameters ¶ filter The optional filter, for filtering...
- getMethods
Note, for ReflectionClass::getMethods() not all methods in a...
- getMethod
Aug 21, 2025 · The getShortName() function is a method of the ReflectionClass class. Its primary purpose is to return the short name of a class, which is essentially the class name without its namespace.
PHP Manual Gets the short name of the class, the part without the namespace.
Sep 7, 2025 · ReflectionClass::getShortName (PHP 5 >= 5.3.0, PHP 7, PHP 8) ReflectionClass::getShortName — Gets short name
The above example will output: bool (false) string (8) "stdClass" string (0) "" string (8) "stdClass" bool (true) string (7) "A\B\Foo" string (3) "A\B" string (3) "Foo"
Nov 11, 2013 · Specifically, you can use the ReflectionClass::getShortName method, which gets the name of the class without its namespace. First, you need to build a ReflectionClass instance, and then call the getShortName method of that instance:
People also ask
How do I get a short name from a reflection class?
How to get the name of a reflection class without a namespace?
How many times can a PHP application get a reflection?
How do I test a class if an object is a member?
Gets the short name of the class, the part without the namespace.
