Hi
I have a rather large array in my script and I was interested how much
memory it uses. Is there a way to get the size of an array in bytes?
BTW: I did RTFM and didn't find an accomidating function, so if there is
one, please point me to it...
TIA
Stefan Rusterholz
--
PHP General Mailing
Had the same problem not long ago and I didn't find a simple solution
either. My solution at the time was the painfully slow one - walking the
array and storing strlen for both key and value. Since you have a large
array, this probably doesn't do for you.
A faster but less accurate solution
Hm, I thought about that way - technically it was indeed a way to go since I
don't want to perform this action everytime but only for testing purposes
(so time doesn't matter).
But aren't arrays in PHP internally stored in a hash-like system which's
size doesn't have to be equal to the sum of
3 matches
Mail list logo