ReflectionConstant::getValue

(PHP 8 >= 8.4.0)

ReflectionConstant::getValueDevuelve el valor

Descripción

public ReflectionConstant::getValue(): mixed

Devuelve el valor de la constante.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

El valor de la constante.

Ejemplos

Ejemplo #1 Ejemplo de ReflectionProperty::getValue()

<?php
const FOO = 'foo';

var_dump((new \ReflectionConstant('FOO'))->getValue());
?>

El resultado del ejemplo sería:

string(3) "foo"
add a note

User Contributed Notes

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