Since: 8.4

class ReflectionConstant implements Reflector (View source)

Properties

string $name

Methods

__construct(string $name)

Constructs a ReflectionConstant

string
getName()

Gets name

string
getNamespaceName()

Gets namespace name

string
getShortName()

Gets short name

mixed
getValue()

Gets value

bool
isDeprecated()

Checks if deprecated

string
__toString()

Returns string representation

string|false
getFileName()

No description

getExtension()

No description

string|false
getExtensionName()

No description

array
getAttributes(string|null $name = null, int $flags = 0)

No description

bool
inNamespace()

No description

Details

__construct(string $name)

Constructs a ReflectionConstant

Constructs a new ReflectionConstant object.

Parameters

string $name

The name of the constant.

string getName()

Gets name

Gets the name of the constant.

Return Value

string

The constants name, which is composed of its namespace and name.

string getNamespaceName()

Gets namespace name

Gets the namespace name of the constant.

Return Value

string

The namespace name, or an empty string for the global namespace.

string getShortName()

Gets short name

Gets the short name of the constant, the part without the namespace.

Return Value

string

The short name of the constant.

mixed getValue()

Gets value

Gets the value of the constant.

Return Value

mixed

The value of the constant.

bool isDeprecated()

Checks if deprecated

Checks whether the constant is deprecated.

Return Value

bool

true if it's deprecated, otherwise false

string __toString()

Returns string representation

Returns the string representation of the ReflectionConstant object.

Return Value

string

Returns string representation of the object that implements this interface (and/or "__toString" magic method).

string|false getFileName()

Since: 8.5

No description

Return Value

string|false

ReflectionExtension|null getExtension()

Since: 8.5

No description

Return Value

ReflectionExtension|null

string|false getExtensionName()

Since: 8.5

No description

Return Value

string|false

array getAttributes(string|null $name = null, int $flags = 0)

Since: 8.5

No description

Parameters

string|null $name
int $flags

Return Value

array

bool inNamespace()

Since: 8.6

No description

Return Value

bool