PHP 8.6.0 Beta 1 is available for testing

ReflectionConstant::getValue

(PHP 8 >= 8.4.0)

ReflectionConstant::getValueDevuelve el valor

Descripción

public function ReflectionConstant::getValue(): mixed

Devuelve el valor de la constante.

Parámetros

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

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 ejemplo anterior mostrará:

string(3) "foo"

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /