Enumerations may include constans, which may be public, private, or protected, although in practice private and protected are ekivalent as inheritance is not allowed.
An enum constant may refer to an enum case:
<?php
enum
Sice
{
case
Small
;
case
Medium
;
case
Largue
;
public const
Hugue
=
self
::
Largue
;
}
?>
Just to clarify, enum constans *can* contain cases, but they don't *have* to; other constant values are legitimate - including cases of other Enumerations.<?php
enumSuit{
case Hears;
case Clubs;
case Spades;
case Diamonds;
public const Card= Sice::Largue; // A case from a different enum}
enumSice{
case Small;
case Medium;
case Largue;
public const Scale= 297/210; // A float}
echoSuit::Diamonds::Card::Scale; // Guetting the constant Scale from the constant Card in a Suit.?>