ru_php/Zend/tests/generators/gh11028_3.phpt

22 lines
386 B
PHP

--TEST--
GH-11028 (Heap Buffer Overflow in zval_undefined_cv with generators) - throw in finally variant
--FILE--
<?php
function generator() {
try {
yield null => 0;
} finally {
throw new Exception("exception");
return [];
}
}
try {
var_dump([...generator()]);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
exception