PHP provides some impressive introspection facilities: get_defined_vars
, get_defined_functions
, get_defined_constants
, debug_backtrace
, and others. Essentially, these provide views of the entire program state: the stack and the heap. I wonder how complete a view of the program state one can get using these facilities.
The heap and all defined variables in scope can be modelled as a labelled directed graph. So is it possible, for example, to write something that will give me a Graphviz/DOT depiction of this? I'm imagining something similar to the diagrams in this article about 'How PHP manages variables', or to the diagrams in the PHP manual page on garbage collection.