Voting

: max(one, two)?
(Example: nine)

The Note You're Voting On

niloofarfs
3 years ago
To get all scalar equivalents values of Backed Enum as an array you could define a method in your Enum:

<?php

enum Suit: string
{
case
Hearts = 'H';
case
Diamonds = 'D';
case
Clubs = 'C';
case
Spades = 'S';

public static function
values(): array
{
return
array_column(self::cases(), 'value');
}
}

?>

<< Back to user notes page

To Top