--TEST-- Enum properties cannot be returned by-ref --FILE-- value; } try { $value = &getBarValueByRef(); $value = 1; } catch (Error $e) { echo $e->getMessage() . "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- Cannot indirectly modify readonly property Foo::$value int(0)