Error on self::class on non final classes
[hiphop-php.git] / hphp / hack / test / typecheck / intersect_null1.php
blob173f6f4c20ee05596a0f7ba633feaf28d63a05f5
1 <?hh // partial
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
12 function get_arr(): array<int> { return varray[1]; }
13 function foo(int $x) {}
15 function test() {
16 foreach (get_arr() as $_) {
17 $y = null;
18 if (true) {
19 $y = 2;
20 } else {
21 $y = 3;
24 foo($y);