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