PHP 8.4.6 Released!

ReflectionConstant::getName

(PHP 8 >= 8.4.0)

ReflectionConstant::getNameGets name

Descripción

public ReflectionConstant::getName(): string

Gets the name of the constant.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

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

Ejemplos

Ejemplo #1 ReflectionConstant::getName() example

<?php
namespace Foo;

const
BAR = 'bar';

echo (new
\ReflectionConstant('Foo\BAR'))->getName();
?>

El resultado del ejemplo sería:

Foo\BAR

Ver también

add a note

User Contributed Notes

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