$ ./guess_the_languageProgramming Languages
Programming Languages · medium · #593

Which programming language is this?

enum Suit: string
{
    case Hearts = 'H';
    case Spades = 'S';
}

echo Suit::from('H')->name;

Answer: PHP

A backed enum Suit: string with case entries and the Suit::from() static call are PHP 8.1.
Play Programming Languages ▸