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