memory_reset_peak_usage

(PHP 8 >= 8.2.0)

memory_reset_peak_usageメモリの最大値をリセットする

説明

memory_reset_peak_usage(): void

memory_get_peak_usage() が返したメモリの最大値をリセットします。

パラメータ

この関数にはパラメータはありません。

戻り値

値を返しません。

例1 memory_reset_peak_usage() の例

<?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)

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant