summaryrefslogtreecommitdiff
path: root/Zend/tests/temporary_cleaning_004.phpt
blob: 8e94b25229eb2e4954d1aecad914224b32e6b2eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Temporary leak with switch
--FILE--
<?php

function ops() {
    throw new Exception();
}

$a = [new stdClass, new stdClass];
switch ($a[0]) {
    case false:
    break;
    default:
        try {
            $x = 2;
            $y = new stdClass;
            while ($x-- && new stdClass) {
                $r = [$x] + ($y ? ((array) $x) + [2] : ops());
                $y = (array) $y;
            }
        } catch (Exception $e) {
        }
}

try {
    switch ($a[0]) {
        case false:
        break;
        default:
            $x = 2;
            $y = new stdClass;
            while ($x-- && new stdClass) {
                $r = [$x] + ($y ? ((array) $x) + [2] : ops());
                $y = (array) $y;
            }
    }
} catch (Exception $e) {
}

?>
==DONE==
--EXPECT--
==DONE==