I know, this question might have been asked a few times before, but I've read all the similar question here and all the answers and still don't understand. So, I have a single variable declaration in my script:
$a = 255;
How much memory will this variable require? I've read this excellent article, which explains how much memory will be allocated for internal PHP structures (like _zval_struct
, _zval_gc_info
, _zend_mm_block_info
). The result is 48
bytes. But on my machine I get 168
bytes. Where do they come from? I'm getting this number by calling memory_get_usage()
before and after the declaration.
I'm running PHP 5.5.18 (64-bit) on Mac OS X.
Thanks in advance.