ReflectionConstant::getShortName
PHP Manual
PHP Manual»ReflectionConstant»ReflectionConstant::getShortName

ReflectionConstant::getShortName

(PHP 8 >= 8.4.0)

ReflectionConstant::getShortNameGets short name

Descrizione

public function ReflectionConstant::getShortName(): string

Gets the short name of the constant, the part without the namespace.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

The short name of the constant.

Esempi

Example #1 ReflectionConstant::getShortName() example

<?php
namespace Foo;

const BAR = 'bar';

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

Il precedente esempio visualizzerà:

BAR

Vedere anche:

To Top