W3cubDocs

/PHP

The ReflectionConstant class

Introduction

(PHP 8 >= 8.4.0)

The ReflectionConstant class reports information about a global constant.

Class synopsis

final class ReflectionConstant implements Reflector {
/* Properties */
public string $name;
/* Methods */
public __construct(string $name)
public getExtension(): ?ReflectionExtension
public getExtensionName(): string|false
public getFileName(): string|false
public getName(): string
public getNamespaceName(): string
public getShortName(): string
public getValue(): mixed
public isDeprecated(): bool
public __toString(): string
}

Properties

name
Name of the constant. Read-only, throws ReflectionException in attempt to write.

See Also

Table of Contents

© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.reflectionconstant.php