PHP 8.4.0 RC3 available for testing

pg_result_memory_size

(PHP 8 >= 8.4.0)

pg_result_memory_sizeReturns the amount of memory allocated for a query result

説明

pg_result_memory_size(PgSql\Result $result): int

Returns the amount of memory, in bytes, allocated to the specified query result PgSql\Result instance. This value is the same amount that would be freed by pg_free_result().

パラメータ

result

pg_query()pg_query_params() や (様々な関数がありますが、特に) pg_execute() が返した PgSql\Result クラスのインスタンス。

戻り値

Returns the memory amount in bytes.

例1 pg_result_memory_size() example

<?php
$db
= pg_connect("dbname=users user=me");

$res = pg_query($db, 'SELECT 1');

$size = pg_result_memory_size($res);

var_dump($size);
?>

上の例の出力は、 たとえば以下のようになります。

int(3288)

参考

add a note

User Contributed Notes

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