1--TEST--
2Temporary leak with foreach
3--XFAIL--
4See Bug #62210 and attempt to fix it in "tmp_livelibess" branch
5--FILE--
6<?php
7
8function ops() {
9    throw new Exception();
10}
11
12$a = [new stdClass, new stdClass];
13foreach ([$a, [new stdClass]] as $b) {
14	switch ($b[0]) {
15		case false:
16		break;
17		default:
18			try {
19				$x = 2;
20				$y = new stdClass;
21				while ($x-- && new stdClass) {
22					$r = [$x] + ($y ? ((array) $x) + [2] : ops());
23					$y = (array) $y;
24				}
25			} catch (Exception $e) {
26			}
27	}
28}
29
30foreach ([$a, [new stdClass]] as $b) {
31	try {
32		switch ($b[0]) {
33			case false:
34			break;
35			default:
36				$x = 2;
37				$y = new stdClass;
38				while ($x-- && new stdClass) {
39					$r = [$x] + ($y ? ((array) $x) + [2] : ops());
40					$y = (array) $y;
41				}
42		}
43	} catch (Exception $e) {
44	}
45}
46
47?>
48==DONE==
49--EXPECT--
50==DONE==
51