Basic flow analysis on if statements
[hiphop-php.git] / hphp / test / slow / readonly / shape.php
blob4f8b52625c937cc226926dd52848970915bd2546
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 = shape("a" => $ro, "b" => $mut);
14 $p["a"]->i = 4; // error, $p is mutable