BackedEnum::fromMaps a scalar to an enum instance Description
public static static BackedEnum::from(intstring
$value )The from method translates a string or int into the corresponding Enum case, if any. If there is no matching case defined, it will throw a ValueError. Parameters
Return ValuesA case instance of this enumeration. ExamplesExample #1 Basic usage The following example illustrates how enum cases are returned.
The above example will output: enum(Suit::Hearts) Fatal error: Uncaught ValueError: "B" is not a valid backing value for enum "Suit" in /file.php:15 See Also
|