Is there anyway to access a listing of all PHP variables?
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 wo开发者_JAVA百科uld 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.
<?php
var_dump(get_defined_vars());
?>
精彩评论