ReflectionConstant::getShortName

(PHP 8 >= 8.4.0)

ReflectionConstant::getShortNameGets short name

Descrizione

public 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'))->getName();
?>

Il precedente esempio visualizzerà:

BAR

Vedere anche:

add a note

User Contributed Notes

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