The ReflectionConstant class

(PHP 8 >= 8.4.0)

Introduction

The ReflectionConstant class reports information about a global constant.

Class synopsis

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

Properties

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

Changelog

Version Description
8.5.0 The class is no longer final.

Table of Contents

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top