title: Unset all variables in PHP 7
body: <p>I'm using the following script in PHP 5.5.9 to unset all variables, which works great</p>
  
  <pre><code>$vars = array_keys(get_defined_vars());
  for ($i = 0; $i &lt; sizeOf($vars); $i++) {
      unset($$vars[$i]);  //this is line 72
  }
  unset($vars,$i);
  </code></pre>
  
  <p>However, in PHP 7, they give the following messages:</p>
  
  <pre><code>PHP Notice:  Array to string conversion in /root/script.php on line 72
  PHP Notice:  Undefined variable: Array in /root/script.php on line 72
  </code></pre>
  
  <p>My question is how to make the script work in PHP 7?</p>
  
  <p>Thanks for any suggestion!</p>