1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/array/bug76778.phpt
Christoph M. Becker 6644bd005f Simplify regression test
There's no need to actually try to trigger an out-of-memory condition
to proof the leak; instead we can simply rely on the Zend MM to report
the memory leaks in debug mode (at least on Linux).  Therefore we
simplify the regression test, which also makes it run much faster.
2018-08-23 12:48:09 +02:00

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===