Reset the peak memory usage

# memory_reset_peak_usage

(PHP 8 >= 8.2.0)

memory_reset_peak_usage — Reset the peak memory usage

### 说明

function memory_reset_peak_usage(): void

Resets the peak memory usage returned by the memory_get_peak_usage() function.

### 参数

此函数没有参数。

### 返回值

没有返回值。

### 示例

示例 #1 memory_reset_peak_usage() example

    <?php

    var_dump(memory_get_peak_usage());

    $a = str_repeat("Hello", 424242);
    var_dump(memory_get_peak_usage());

    unset($a);
    memory_reset_peak_usage();

    $a = str_repeat("Hello", 2424);
    var_dump(memory_get_peak_usage());

    ?>

以上示例的输出类似于：

    int(422440)
    int(2508672)
    int(399208)

### 参见

- memory_get_peak_usage() - 返回分配给 PHP 内存的峰值

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open