Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ReflectionClassConstant::getModifiersReflectionClassConstant::getType>
^ReflectionClassConstantLast updated: Mon, 26 Oct 2026

ReflectionClassConstant::getName

(PHP 7 >= 7.1.0, PHP 8)

ReflectionClassConstant::getName — Get name of the constant

Description

public function ReflectionClassConstant::getName(): string

Parameters

This function has no parameters.

Return Values

Returns the constant's name.

Changelog

Version Description
8.1.0 Throws an Error in case the name property has not been initialized. Previously, the method returned false on failure.

<ReflectionClassConstant::getModifiersReflectionClassConstant::getType>
^ReflectionClassConstantLast updated: Mon, 26 Oct 2026