2015-12-22 03:22:11 +08:00
|
|
|
--TEST--
|
|
|
|
int memory_get_peak_usage ([ bool $real_usage = false ] );
|
|
|
|
--CREDITS--
|
|
|
|
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
2016-05-08 13:04:20 +08:00
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
|
|
|
if ($zend_mm_enabled === "0") {
|
|
|
|
die("skip Zend MM disabled");
|
|
|
|
}
|
|
|
|
?>
|
2015-12-24 21:44:07 +08:00
|
|
|
--INI--
|
|
|
|
memory_limit=-1
|
2015-12-22 03:22:11 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2015-12-24 20:33:22 +08:00
|
|
|
var_dump($a = memory_get_peak_usage());
|
2015-12-22 03:22:11 +08:00
|
|
|
var_dump(memory_get_peak_usage(true));
|
|
|
|
var_dump(memory_get_peak_usage(false));
|
2015-12-24 20:33:22 +08:00
|
|
|
$array = range(1,1024*1024);
|
|
|
|
var_dump(memory_get_peak_usage() > $a);
|
2015-12-22 03:22:11 +08:00
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
int(%d)
|
|
|
|
int(%d)
|
|
|
|
int(%d)
|
2015-12-24 20:33:22 +08:00
|
|
|
bool(true)
|