1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/try/bug71604_3.phpt
Nikita Popov 921b3251b3 Fix bug #71604
Alternatively could throw some kind of uncatchable dummy exception
into the generator. Right now just checking for NULL in two places
seems simpler.
2016-05-28 14:40:32 +02:00

39 lines
596 B
PHP

--TEST--
Bug #71604: Aborted Generators continue after nested finally (3)
--FILE--
<?php
function gen() {
try {
throw new Exception(1);
} finally {
try {
yield;
} finally {
try {
throw new Exception(2);
} finally {
}
}
}
}
try {
gen()->rewind();
} catch (Exception $e) {
echo $e, "\n";
}
?>
--EXPECTF--
Exception: 1 in %s:%d
Stack trace:
#0 [internal function]: gen()
#1 %s(%d): Generator->rewind()
#2 {main}
Next Exception: 2 in %s:%d
Stack trace:
#0 %s(%d): gen()
#1 {main}