You have created a backed enum “Fruit” as follows in PHP.
<?php
enum Fruit: string
case Apple = ‘A’;
case Lemon = ‘L’;
case Orange = ‘O’;
case Tomato = ‘T’;
}
?>
In the given context, what will happen if a variable is assigned as a reference to the backed case Lemon?
Options
- The value property of Lemon is enforced to be read-only
- The following error is thrown:
- Error: Cannot acquire reference to property Fruit::$value
- The value L is printed
- A ValueError is thrown