(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
An PgSql\Result instance, returned by pg_query(), pg_query_params() or pg_execute()(among others).
Returns the memory amount in bytes.
Example #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);
?>
The above example will output something similar to:
int(3288)
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