Is there a function in PHP (or a PHP extension) to find out how much memory a given variable uses? sizeof just tells me the number of elements/properties.
sizeof
No, there is not. But you can serialize($var) and check the strlen of the result for an approximation.