Enumerations

Type initialization

<?php

//no enum type before PHP 8.1;
//here - class constants
abstract class PreciousMetal   {
    const Platinum = 0;
    const Gold = 1;
    const Silver = 2;
}

$gold  = PreciousMetal ::Gold;

echo $gold;