views:

44

answers:

1

I created a singleton registry to contain instances of all my objects, and I try to unset variables when they are no longer in use. However, I can't seem to ever find all of the variables in use. There always seems to be a couple hundred KB that I can't explain floating around...

I'm not sure it this is possible, but can you access an internal variable listing in PHP somewhere? That would sure help with code audits to keep things clean and working fast.

I tried looking through xdebug and xdebug_debug_zval_stdout seemed to be the closest thing to tracking references and more detailed variable information - but it can't guess what values are already out there.

+2  A: 
<?php
 var_dump(get_defined_vars());
?>
Pentium10
Remember to use this in each variable scope - but it works great!
Xeoncross