php-src/Zend/tests/memory_reset_peak_usage.phpt
2022-03-04 13:24:08 +01:00

24 lines
451 B
PHP

--TEST--
void memory_reset_peak_usage();
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0") {
die("skip Zend MM disabled");
}
?>
--INI--
memory_limit=-1
--FILE--
<?php
$array0 = range(1, 1024 * 1024);
$m0 = memory_get_peak_usage();
$array1 = range(1, 1024 * 1024);
var_dump(($m1 = memory_get_peak_usage()) > $m0);
unset($array0, $array1);
memory_reset_peak_usage();
var_dump(memory_get_peak_usage() < $m1);
?>
--EXPECT--
bool(true)
bool(true)