title: Displaying get_defined_vars() as an array which can contain html in values
body: <p>As the title says, I want to make a &quot;debug&quot; site that displays the <code>get_defined_vars()</code> vars as an array.</p>
  <p>It seems like some variables contain or can contain HTML or even dynamic code like PHP.</p>
  <p>First I tried the classic:</p>
  <pre><code>&lt;pre&gt;
  &lt;?=print_r(get_defined_vars());?&gt;
  &lt;/pre&gt;
  </code></pre>
  <p>then I played with <code>htmlentities()</code> and <code>htmlspecialchars()</code> commands and wrote this:</p>
  <pre><code>$allVars=get_defined_vars();
  array_walk_recursive($allVars, function (&amp;$value) {
      $value = htmlspecialchars($value, ENT_QUOTES);
  });
  print_r($allVars);
  </code></pre>
  <p>this takes forever and outputs a blank sheet :-)</p>
  <p>What would be the best way to do this?</p>