title: PHP - Unexpected Global, expecting String in class
body: <p>In my class (Which is actually a CakePHP model) I'm trying to simply set a variable and then access it from inside a function but I'm getting the following error:</p>
  
  <p><strong>Parse error: syntax error, unexpected T_GLOBAL, expecting T_FUNCTION in /path/to/file/file.php on line 120</strong> </p>
  
  <p>Line 120 onwards of my file is as follows:</p>
  
  <pre><code>global $accessid = 'accessid';
  global $secret = "secret";
  global $b = 0;
  global $m = 0;
  
  function generateCredentials() {    
      global $accessid;
  
      return $accessid;
  }
  </code></pre>
  
  <p>Any idea where I'm going wrong?
  Thanks!</p>