title: PHP, Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION
body: <p><code>Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:\wamp\www\Exam Creator\cls_FillInTheBlank.php on line 31</code></p>
  
  <p>I received this error while trying to run the cls_FillInTheBlank.php which includes cls_template.php. I have the two files posted at the for review.</p>
  
  <h3><code>cls_FillInTheBlank.php</code></h3>
  
  <pre><code>&lt;?php
  
      include("cls_template.php");
  
  class fillintheblank{
  
      function _construct(){
          $cls_blankInput = new template;
          $cls_questionString = new template;
          $cls_fillInTheBlank = new template;
      }
  
      if(class_exists($cls_blankInput)){
          $cls_blankInput-&gt;fillString("&lt;input type='text' name='[qInputName]' id='[qInputId]' value='[qInputValue]' /&gt;");
          $cls_blankInput-&gt;fillPlaceholderStrings(array("[qInputName]","[qInputId]","[qInputValue]"));
      } else {
          print("\$cls_blankInput not defined.&lt;br&gt;");
      }
  
      if(class_exists($cls_questionString)){
          $cls_questionString-&gt;fillString("");    // to be set later
          $cls_questionString-&gt;fillPlaceholderStrings(array("[fib_blank]"));
      } else {
          print("\$cls_questionString not defined.&lt;br&gt;");
      }
  
      if(class_exists($cls_fillInTheBlank)){
          $cls_fillInTheBlank-&gt;fillString("&lt;li&gt;[qFillInTheBlankString]&lt;/li&gt;");
          $cls_fillInTheBlank-&gt;fillPlaceholderStrings(array("[qFillInTheBlankString]"));
      } else {
          print("\$cls_fillInTheBlank not defined.&lt;br&gt;");
      }
  
      public function q_fib_buildString($cls_question){
          $i_qID = "";            // @type INTEGER
          $s_html = "";           // @type STRING
          $a_inputs = "";         // @type ARRAY
          $s_innerHTML = "";      // @type STRING
          $s_outerHTML = "";      // @type STRING
  
          $i_qID = $cls_question-&gt;qo_i_id;
  
          // build the HTML for the blank input
          foreach($cls_question-&gt;qo_a_answerSet as $answer){
              $this-&gt;cls_blankInput-&gt;fillPlaceholderValues(array("qID_".$i_qID,"qID_".$i_qID,$answer["value"]));
              $a_inputs[count($a_inputs)] = $this-&gt;cls_blankInput-&gt;buildTemplate();
          }
  
          // build the inner HTML
          $this-&gt;cls_questionString-&gt;fillString($cls_question-&gt;qo_s_string);
          $this-&gt;cls_questionString-&gt;fillPlaceholderValues($a_inputs);
          $s_innerHTML = $this-&gt;cls_blankInput-&gt;buildTemplate();
  
  
          // build the outer HTML
          $this-&gt;cls_fillInTheBlank-&gt;fillPlaceholderValues($s_innerHTML);
          $outerHTML =  $this-&gt;cls_fillInTheBlank-&gt;buildTemplate();
  
          return $outerHTML;
  
      }
  
      public function q_fib_buildString($s_template){
          $s_fib_patterns = array();
          $s_input_blank = "";
          $s_fib_patterns_blank = "[\[fib_blank\]]";
  
          // array of placeholders 
          $a_fib_patterns['input'] = array();
              // place holder for the name attribute of the input tag
              $a_fib_patterns['attribute']['name'] ="[\[qInputName\]]";
              // place holder for the id attribute of the input tag
              $a_fib_patterns['attribute']['id'] = "[\[qInputId\]]";
  
          // array of values
          $a_fib_replace['value'] = array();
              // value for the name attribute
              $a_fib_replace['value']['name'] = "qId_".$i_id."[]";
              // value fo the id attribute
              $a_fib_replace['value']['id'] = "qId_".$i_id."[]";
  
          // build blank input
          $s_input_blank = preg_replace($a_fib_patterns['input'],$a_fib_replace['value'],fillintheblank::$s_blankInput);
          // build question string
          $s_string = preg_replace($s_fib_patterns_blank,$s_input_blank,$s_string);
  
          /* START CODE FOR TESTING */
  //      echo($s_input_blank);   // echo code for the blank inputs
          /* END CODE FOR TESTING */
  
          // return question string
          return $s_string;
  
      }
  
  }
  
  ?&gt;
  </code></pre>