php-src/Zend/tests/fe_fetch_dtor_exception.phpt
Nikita Popov c136afa2be Fix FE_FETCH_* exception check
Only applying this for 7.2, because handling this would be ugly
under the old retval freeing semantics.
2017-06-25 16:45:17 +02:00

23 lines
310 B
PHP

--TEST--
Dtor may throw exception furing FE_FETCH assignment
--FILE--
<?php
$v = new class {
function __destruct() {
throw new Exception("foo");
}
};
try {
foreach ([1, 2] as $v) {
var_dump($v);
}
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
foo