array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), '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-Funktionen', ), '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); ?>

pg_result_memory_size

(PHP 8 >= 8.4.0)

pg_result_memory_sizeReturns the amount of memory allocated for a query result

Beschreibung

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().

Parameter-Liste

result

Eine PgSql\Result-Instanz, die von pg_query(), pg_query_params() oder pg_execute() (unter anderen) zurückgegeben wurde.

Rückgabewerte

Returns the memory amount in bytes.

Beispiele

Beispiel #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);
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

int(3288)

Siehe auch