diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-23 12:44:06 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-23 12:48:09 +0200 |
commit | 6644bd005f94993d9e479c02ab1acd650e1181a8 (patch) | |
tree | d5e8cfb2796b326e5e775649c2517cf85bc2f3c9 /ext/standard/tests/array | |
parent | 32a728d351aab4bac28790697cd6820a8843645f (diff) | |
download | php-git-6644bd005f94993d9e479c02ab1acd650e1181a8.tar.gz |
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.
Diffstat (limited to 'ext/standard/tests/array')
-rw-r--r-- | ext/standard/tests/array/bug76778.phpt | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/ext/standard/tests/array/bug76778.phpt b/ext/standard/tests/array/bug76778.phpt index e213961ce2..60f42b744d 100644 --- a/ext/standard/tests/array/bug76778.phpt +++ b/ext/standard/tests/array/bug76778.phpt @@ -1,24 +1,16 @@ --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=128M --FILE-- <?php -for ($i = 0; $i < 100; $i++) { - try { - array_reduce( - [1], - function ($carry, $item) { - throw new Exception; - }, - range(1, 200000) - ); - } catch (Exception $e) { - } +try { + array_reduce( + [1], + function ($carry, $item) { + throw new Exception; + }, + range(1, 3) + ); +} catch (Exception $e) { } ?> ===DONE=== |