--TEST-- BackedEnum::from() reject invalid type --FILE-- getMessage() . "\n"; } enum Foo: int { case Bar = 0; case Baz = 1; } try { var_dump(Foo::from('H')); } catch (Error $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- "42" is not a valid backing value for enum "Suit" Foo::from(): Argument #1 ($value) must be of type int, string given