BaseL instructions and corresponding tests
[hiphop-php.git] / hphp / test / slow / readonly / local_variable_vec_ok.php
blob591a24dc42901db94ccea0e30cfe8571964c8595
1 <?hh
2 <<file:__EnableUnstableFeatures('readonly')>>
3 class Baz {
5 class Foo {
6 public int $prop;
7 public readonly vec<Foo> $bar = vec[];
8 public static readonly vec<Foo> $static_vec = vec[];
9 public readonly Baz $baz;
10 public function __construct() {
11 $this->prop = 1;
12 $this->baz = new Baz();
16 <<__EntryPoint>>
17 function main(): void {
18 $y = vec[readonly new Foo()];
19 $y[] = new Foo(); // ok
20 echo "Done\n";