array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.pg-result-memory-size.php', 1 => 'pg_result_memory_size', 2 => 'Returns the amount of memory allocated for a query result', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL Функції', ), 'prev' => array ( 0 => 'function.pg-result-error-field.php', 1 => 'pg_result_error_field', ), 'next' => array ( 0 => 'function.pg-result-seek.php', 1 => 'pg_result_seek', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pgsql/functions/pg-result-memory-size.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.4.0)
pg_result_memory_size — Returns the amount of memory allocated for a query result
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)