title: How to determine the memory footprint (size) of a variable?
body: <p>Is there a function in PHP (or a PHP extension) to find out how much memory a given variable uses? <code>sizeof</code> just tells me the number of elements/properties.</p>
  
  <p><code>memory_get_usage</code> helps in that it gives me the memory size used by the <em>whole</em> script. Is there a way to do this for a single variable?</p>
  
  <p>Note that this is on a development machine, so loading extensions or debug tools is feasible.</p>