PHP - non-recursive var_dump?
<p>When dealing with certain PHP objects, it's possible to do a <code>var_dump()</code> and PHP prints values to the screen that go on and on and on until the PHP memory limit is reached I assume. An example of this is dumping a Simple HTML DOM object. I assume that because you are able to traverse children and parents of objects, that doing <code>var_dump()</code> gives infinite results because it finds the parent of an object and then recursively finds it's children and then finds all those children's parents and finds those children, etc etc etc.  It will just go on and on.</p>

<p>My question is, how can you avoid this and keep PHP from dumping recursively dumping out the same things over and over? Using the Simple HTML DOM parser example, if I have a DOM object that has no children and I <code>var_dump()</code> it, I'd like it to just dump the object and no start traversing up the DOM tree and dumping parents, grandparents, other children, etc.</p>
