Readonly in emitter flag
[hiphop-php.git] / hphp / test / slow / readonly / keyvalcollection.php
blob52f5505349b75d55b5936e65c7380be3b6404bc0
1 <?hh //strict
3 <<file: __EnableUnstableFeatures('readonly')>>
5 class P {
6 public function __construct(public int $i) { }
9 <<__EntryPoint>>
10 function main() {
11 $ro = readonly new P(1);
12 $mut = new P(1);
13 $p = Map {1 => $ro, 2 => $mut};
14 $p[2]->i = 4; // error, $p[2] is readonly because $p is readonly