PHP 8.5.0 Alpha 2 available for testing

ReflectionConstant::getShortName

(PHP 8 >= 8.4.0)

ReflectionConstant::getShortNameDevuelve el nombre corto

Descripción

public ReflectionConstant::getShortName(): string

Devuelve el nombre corto de la constante, la parte sin el espacio de nombres.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

El nombre corto de la constante.

Ejemplos

Ejemplo #1 Ejemplo de ReflectionConstant::getShortName()

<?php
namespace Foo;

const
BAR = 'bar';

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

El ejemplo anterior mostrará :

BAR

Ver también

add a note

User Contributed Notes

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