2015-07-10 00:46:57 +00:00
|
|
|
--TEST--
|
|
|
|
Temporary leak with switch
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
function ops() {
|
|
|
|
throw new Exception();
|
|
|
|
}
|
|
|
|
|
|
|
|
$a = [new stdClass, new stdClass];
|
|
|
|
switch ($a[0]) {
|
2020-02-03 21:52:20 +00:00
|
|
|
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) {
|
|
|
|
}
|
2015-07-10 00:46:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2020-02-03 21:52:20 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2015-07-10 00:46:57 +00:00
|
|
|
} catch (Exception $e) {
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
==DONE==
|
|
|
|
--EXPECT--
|
|
|
|
==DONE==
|