1--TEST-- 2BackedEnum::from() reject invalid string 3--FILE-- 4<?php 5 6enum Suit: string { 7 case Hearts = 'H'; 8 case Diamonds = 'D'; 9 case Clubs = 'C'; 10 case Spades = 'S'; 11} 12 13try { 14 var_dump(Suit::from('A')); 15} catch (Error $e) { 16 echo $e->getMessage() . "\n"; 17} 18 19?> 20--EXPECT-- 21"A" is not a valid backing value for enum "Suit" 22