title: Parse error: syntax error, unexpected '('
body: <p>I have an helper class like this:</p>
  
  <pre><code>class Helper{   
  
      public static $app_url = self::getServerUrl();
      /**
      * Gets server url path
      */
      public static function getServerUrl(){
          global $cfg; // get variable cfg as global variable from config.php Modified by Gentle
  
          $port = $_SERVER['SERVER_PORT'];
          $http = "http";
  
          if($port == "80"){
            $port = "";  
          }
  
          if(!empty($_SERVER["HTTPS"]) &amp;&amp; $_SERVER["HTTPS"] == "on"){
             $http = "https";
          }
          if(empty($port)){
             return $http."://".$_SERVER['SERVER_NAME']."/".$cfg['afn'];
          }else{
             return $http."://".$_SERVER['SERVER_NAME'].":".$port."/".$cfg['afn']; 
          }        
      }
  }
  </code></pre>
  
  <p>And its given me:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '(' on the line with   public static $app_url = self::getServerUrl();</p>
  </blockquote>