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