1--TEST-- 2Readonly enum properties should not be writable via cache slot merging 3--FILE-- 4<?php 5 6enum Test { 7 case A; 8 9 public function modify() { 10 // Cache slots for the read and write are merged. 11 var_dump($this->name); 12 $this->name = 'foobar'; 13 } 14} 15 16try { 17 Test::A->modify(); 18} catch (Error $e) { 19 echo $e->getMessage(), "\n"; 20} 21var_dump(Test::A->name); 22 23?> 24--EXPECT-- 25string(1) "A" 26Cannot modify readonly property Test::$name 27string(1) "A" 28