<?php//PHP 8.1 之前没有枚举类型;//这里用类常量代替abstract class PreciousMetal { const Platinum = 0; const Gold = 1; const Silver = 2;}$gold = PreciousMetal ::Gold;echo $gold;