title: Unexpected T_VARIABLE error
body: <p>Okay, I know this is a common enough question, but all the solutions I've found thus far have involved a missing semi-colon or curly brace, both of which I know is not the case for me.</p>
  
  <p>I have a class that works FINE with this variable assignment:</p>
  
  <p><strong>session.php:</strong></p>
  
  <pre><code>&lt;?php
  
     class session {
       ... 
       var $host = 'localhost';
       ...
     }
  
  ?&gt;
  </code></pre>
  
  <p>Great. But I want to have my database details in another file, so I did this:</p>
  
  <p><strong>db_creds.php:</strong></p>
  
  <pre><code>&lt;?php
  
     var $db_creds = array(
        'host' =&gt; 'localhost',
        ...
     );
  
  ?&gt;
  </code></pre>
  
  <p><strong>session.php</strong></p>
  
  <pre><code>&lt;?php
  
     include('db_creds.php');
  
     class session {
       ... 
       var $host = $db_creds['host'];
       ...
     }
  
  ?&gt;
  </code></pre>
  
  <p>Which then gave me this error: <code>Parse error: syntax error, unexpected T_VARIABLE in ../session.php on line 74</code>, where line 74 is my <code>var $host</code> assignment.</p>
  
  <p>I even tried doing this in <strong>session.php</strong>, just to be sure the problem wasn't in the include:</p>
  
  <p><strong>session.php</strong></p>
  
  <pre><code>&lt;?php
  
     # include('db_creds.php');
  
     class session {
       ...
       var $db_host = 'localhost';
       var $host = $db_host;
       ...
     }
  
  ?&gt;
  </code></pre>
  
  <p>... but that just throws the same error as above. </p>
  
  <p>Can anyone tell me what's happening here? I'm at my wits end!</p>