1--TEST-- 2Enum can use traits having constants 3--FILE-- 4<?php 5 6trait Rectangle { 7 private const MESSAGE_RECTANGLE = 'Rectangle'; 8 9 public function shape(): string { 10 return self::MESSAGE_RECTANGLE; 11 } 12} 13 14enum Suit { 15 use Rectangle; 16 17 case Hearts; 18 case Diamonds; 19 case Clubs; 20 case Spades; 21} 22 23echo Suit::Hearts->shape() . PHP_EOL; 24echo Suit::Diamonds->shape() . PHP_EOL; 25echo Suit::Clubs->shape() . PHP_EOL; 26echo Suit::Spades->shape() . PHP_EOL; 27 28?> 29--EXPECT-- 30Rectangle 31Rectangle 32Rectangle 33Rectangle 34