Skip to content

Instantly share code, notes, and snippets.

@Srokap Srokap/test.php
Created May 9, 2013

Embed
What would you like to do?
Timestamp in int or string memory consumption
$mx = 10000;
$mem = memory_get_usage();
$data1 = array();
$i = $mx;
while ($i-- >0) {
$data1[] = 1368118712;
}
$i1 = (memory_get_usage() - $mem);
echo ' ';
$mem = memory_get_usage();
$data2 = array();
$i = $mx;
while ($i-- >0) {
$data2[] = '1368118712';
}
$i2 = (memory_get_usage() - $mem);
echo $i2/$i1;
echo ' ';
echo count($data1);
echo ' ';
echo count($data2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.