title: Why am I getting Parse error in Tutorial code
body: <p>Full disclosure - I've been away from PHP for a while so bought a book to refresh and have been going through it.  When I run one of the simple scripts to illustrate &quot;variable variables&quot; I get the infamous &quot;unexpected T_VARIABLE&quot; parse error.
  Specifially the error I get is &quot;Parse error: syntax error, unexpected '$temp' (T_VARIABLE) in ... &quot;</p>
  <p>I did look at about a dozen similar questions but none of those threads helped with this particular code.</p>
  <p>Here is the code in question:</p>
  <pre><code>    &lt;?php
      
      $numnames = 15;
       for($i=1; $i &lt;= $numnames; $i++){
        $temp = “name$i”;
      echo htmlspecialchars($$temp).’&lt;br /&gt;’;
      }
      
      ?&gt;
  </code></pre>
  <p>What I would expect is something like this:</p>
  <p>name1
  name2
  name3
  .
  .
  .
  name15
  I think all the brackets and parens are closed properly and semicolons are all in place (I think).
  Any ideas why I'm getting this error?</p>