1--TEST--
2Temporary leak with switch
3--FILE--
4<?php
5
6function ops() {
7    throw new Exception();
8}
9
10$a = [new stdClass, new stdClass];
11switch ($a[0]) {
12    case false:
13    break;
14    default:
15        try {
16            $x = 2;
17            $y = new stdClass;
18            while ($x-- && new stdClass) {
19                $r = [$x] + ($y ? ((array) $x) + [2] : ops());
20                $y = (array) $y;
21            }
22        } catch (Exception $e) {
23        }
24}
25
26try {
27    switch ($a[0]) {
28        case false:
29        break;
30        default:
31            $x = 2;
32            $y = new stdClass;
33            while ($x-- && new stdClass) {
34                $r = [$x] + ($y ? ((array) $x) + [2] : ops());
35                $y = (array) $y;
36            }
37    }
38} catch (Exception $e) {
39}
40
41?>
42==DONE==
43--EXPECT--
44==DONE==
45