summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/bug76778.phpt
blob: 2c65497d12145e9afbe522c7989981cfef5016eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Bug #76778 (array_reduce leaks memory if callback throws exception)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
?>
--INI--
memory_limit=32M
--FILE--
<?php
for ($i = 0; $i < 100; $i++) {
    try {
        array_reduce(
            [1],
            function ($carry, $item) {
                throw new Exception;
            },
            range(1, 200000)
        );
    } catch (Exception $e) {
    }
}
?>
===DONE===
--EXPECT--
===DONE===