php-8.0.30-src/ext/standard/tests/array/bug76778.phpt

19 lines
298 B
PHP

--TEST--
Bug #76778 (array_reduce leaks memory if callback throws exception)
--FILE--
<?php
try {
array_reduce(
[1],
function ($carry, $item) {
throw new Exception;
},
range(1, 3)
);
} catch (Exception $e) {
}
?>
===DONE===
--EXPECT--
===DONE===