array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'reflectionenumunitcase.getvalue.php', 1 => 'ReflectionEnumUnitCase::getValue', 2 => 'Gets the enum case object described by this reflection object', ), 'up' => array ( 0 => 'class.reflectionenumunitcase.php', 1 => 'ReflectionEnumUnitCase', ), 'prev' => array ( 0 => 'reflectionenumunitcase.getenum.php', 1 => 'ReflectionEnumUnitCase::getEnum', ), 'next' => array ( 0 => 'class.reflectionenumbackedcase.php', 1 => 'ReflectionEnumBackedCase', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/reflection/reflectionenumunitcase/getvalue.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.1.0)
ReflectionEnumUnitCase::getValue — Gets the enum case object described by this reflection object
Returns the enum case object described by this reflection object.
У цієї функції немає параметрів.
The enum case object described by this reflection object.
Приклад #1 ReflectionEnum::getValue() example
<?php
enum Suit
{
case Hearts;
case Diamonds;
case Clubs;
case Spades;
}
$rEnum = new ReflectionEnum(Suit::class);
$rCase = $rEnum->getCase('Diamonds');
var_dump($rCase->getValue());
?>Поданий вище приклад виведе:
enum(Suit::Diamonds)