UnitEnum::casesGenerates a list of cases on an enum Description
public static array UnitEnum::cases()
This method will return a packed array of all cases in an enumeration, in order of declaration. ParametersThis function has no parameters. Return ValuesAn array of all defined cases of this enumeration, in order of declaration. ExamplesExample #1 Basic usage The following example illustrates how enum cases are returned.
The above example will output: array(4) { [0]=> enum(Suit::Hearts) [1]=> enum(Suit::Diamonds) [2]=> enum(Suit::Clubs) [3]=> enum(Suit::Spades) } |