[PHP] Size of array in bytes

2001-12-20 Thread Stefan Rusterholz
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

Re: [PHP] Size of array in bytes

2001-12-20 Thread Bogdan Stancescu
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

Re: [PHP] Size of array in bytes

2001-12-20 Thread Stefan Rusterholz
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