mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Added test
This commit is contained in:
parent
4c6aa93d43
commit
cfcedf2fb4
1 changed files with 32 additions and 0 deletions
32
Zend/tests/try/bug70228_4.phpt
Normal file
32
Zend/tests/try/bug70228_4.phpt
Normal file
|
@ -0,0 +1,32 @@
|
|||
--TEST--
|
||||
Bug #70228 (memleak if return in finally block)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
try {
|
||||
throw new Exception(1);
|
||||
} finally {
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
} finally {
|
||||
return 42;
|
||||
}
|
||||
} finally {
|
||||
throw new Exception(3);
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(test());
|
||||
} catch (Exception $e) {
|
||||
do {
|
||||
echo $e->getMessage() . "\n";
|
||||
$e = $e->getPrevious();
|
||||
} while ($e);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
1
|
Loading…
Add table
Add a link
Reference in a new issue