1--TEST--
2Enum properties cannot be unset
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8}
9
10enum IntFoo: int {
11    case Bar = 0;
12}
13
14$foo = Foo::Bar;
15try {
16    unset($foo->name);
17} catch (Error $e) {
18    echo $e->getMessage() . "\n";
19}
20
21$intFoo = IntFoo::Bar;
22try {
23    unset($intFoo->name);
24} catch (Error $e) {
25    echo $e->getMessage() . "\n";
26}
27try {
28    unset($intFoo->value);
29} catch (Error $e) {
30    echo $e->getMessage() . "\n";
31}
32
33?>
34--EXPECT--
35Cannot unset readonly property Foo::$name
36Cannot unset readonly property IntFoo::$name
37Cannot unset readonly property IntFoo::$value
38