php-src/Zend/tests/exception_set_previous_leak.phpt
Nikita Popov fc6f53d426 Fix leak when setting cyclic previous exception in finally
A curious exception handling pattern found in Symfony's HttpClient.
2020-06-30 12:24:32 +02:00

21 lines
314 B
PHP

--TEST--
Leak when setting recursive previous exception in finally handling
--FILE--
<?php
try {
try {
throw new Exception("Test");
} catch (Exception $e) {
throw $e;
} finally {
throw $e;
}
} catch (Exception $e2) {
echo $e2->getMessage(), "\n";
}
?>
--EXPECT--
Test