1--TEST--
2Enum properties cannot be written to through references
3--FILE--
4<?php
5
6enum Foo: int {
7    case Bar = 0;
8}
9
10try {
11    $bar = Foo::Bar;
12    $value = &$bar->value;
13    $value = 1;
14} catch (Error $e) {
15    echo $e->getMessage() . "\n";
16}
17
18var_dump(Foo::Bar->value);
19
20?>
21--EXPECT--
22Cannot modify readonly property Foo::$value
23int(0)
24