Readonly in emitter flag
[hiphop-php.git] / hphp / test / slow / readonly / darray.php
blob81630ab1f3a965777b4dd9e9173628b4b239a13c
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 = darray[1 => $ro, 2 => $mut];
14 // error, $p[2] is readonly because $p is readonly
15 $p[2]->i = 4;