ReflectionConstant::getName
PHP Manual
PHP Manual»ReflectionConstant»ReflectionConstant::getName

ReflectionConstant::getName

(PHP 8 >= 8.4.0)

ReflectionConstant::getNameGets name

Descrizione

public function ReflectionConstant::getName(): string

Gets the name of the constant.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

Example #1 ReflectionConstant::getName() example

<?php
namespace Foo;

const BAR = 'bar';

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

Il precedente esempio visualizzerà:

Foo\BAR

Vedere anche:

To Top