International PHP Conference Munich 2025

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

PgSql\Result 实例,由 pg_query()pg_query_params() 或者 pg_execute()(等)返回。

返回值

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)

参见

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
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