大网数据广告活动
PHP 语言与运行手册

pg_result_memory_size · Returns the amount of memory allocated for a query result

· 52CE 我爱测

pg_result_memory_size — Returns the amount of memory allocated for a query result

pg_result_memory_size

(PHP 8 >= 8.4.0)

pg_result_memory_size — Returns the amount of memory allocated for a query result

说明

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

参见

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。