title: PHP, unexpected T_IF, expecting T_FUNCTION in xxx file on line xxx
body: <p>Very strange, I got code running on my localhost, but when I deployed it on remote server. it got T_IF error. The code is as follow: </p>
  
  <p>The xxx line is around:  $experiment['import_result'] = TRUE;</p>
  
  <pre><code>private function do_import($file_info, $ih_id){
  
      $this-&gt;load-&gt;library("MY_PHPExcel");
      $inputFileName = $file_info['full_path']; 
      $sheetNames = array('General','Gas', 'Sample', 'Mass Gain', 'Cr'); 
  
      /**  Identify the type of $inputFileName  **/ 
      $inputFileType = PHPExcel_IOFactory::identify($inputFileName); 
      /**  Create a new Reader of the type that has been identified  **/ 
      $objReader = PHPExcel_IOFactory::createReader($inputFileType); 
      /**  Advise the Reader that we only want to load cell data  **/ 
      $objReader-&gt;setReadDataOnly(true);
      /**  Advise the Reader of which WorkSheets we want to load  **/  
      $objReader-&gt;setLoadSheetsOnly($sheetNames); 
      /**  Tell the Reader that we want to use the Read Filter  **/  
      //$objReader-&gt;setReadFilter($filterSubset);
      /**  Load $inputFileName to a PHPExcel Object  **/ 
      $objPHPExcel = $objReader-&gt;load($inputFileName);
      $sheetCount=$objPHPExcel-&gt;getSheetCount();
  
      $experiment = array();
      for($index = 0; $index&lt;$sheetCount; $index++){
          $objPHPExcel-&gt;setActiveSheetIndex($index);
          $sheetName = $objPHPExcel-&gt;getActiveSheet()-&gt;getTitle();
          if($sheetName == 'General'){
              $experiment['general'] = $this-&gt;read_general($objPHPExcel, $index, 1);
          }elseif($sheetName == 'Sample'){
              $experiment['sample'] = $this-&gt;read_sample($objPHPExcel, $index, 1);
          }elseif($sheetName == 'Gas'){
              $experiment['gas'] = $this-&gt;read_gas($objPHPExcel, $index, 1);
          }elseif($sheetName == 'Mass Gain'){
              $experiment['mass'] = $this-&gt;read_mass($objPHPExcel, $index, 1);
          }elseif($sheetName == 'Cr'){
              $experiment['cr'] = $this-&gt;read_cr($objPHPExcel, $index, 1);
          }
      }
  
  
      //if there is format error 
      foreach($experiment as $sheet){
          if(isset($sheet) &amp;&amp; !empty($sheet)){
              if(isset($sheet['error']) &amp;&amp; !empty($sheet['error'])){
                  $experiment['import_result'] = FALSE;
                  break 1;
              }elseif(isset($sheet['validation']['validation']) &amp;&amp; $sheet['validation']['validation'] == 0){
                  $experiment['import_result'] = FALSE;
                  break 1;
              }else{
                  $experiment['import_result'] = TRUE;
                  break 1;
              }
          }
      }
  
      if($experiment['import_result']){//there is no format error, proceed to import
          //do import into DB
          $import_flag = 0;
          $post_data = $this-&gt;input-&gt;post();
  
          if(isset($post_data['import_radio']) &amp;&amp; $post_data['import_radio'] == 1){//new 
              $import_flag = $this-&gt;m_import-&gt;import_experiment_new($experiment, $this-&gt;session-&gt;userdata('user_id'), $ih_id);
          }elseif(isset($post_data['import_radio']) &amp;&amp; $post_data['import_radio'] == 2){//update
              //debug
              //$this-&gt;firephp-&gt;log('update an existing experiment');
              $import_flag = $this-&gt;m_import-&gt;import_experiment_update($post_data['import_eid'], $experiment, $this-&gt;session-&gt;userdata('user_id'), $ih_id);
          }else{//didn't choose a mode
              return array('status'=&gt;4, 'message'=&gt;'Please select "new" or "update".');
          }
  
          if($import_flag != 0){//import done ok
              if($post_data['import_radio'] == 1){
                  return array('status'=&gt;1, 'message'=&gt;'File has been successfully imported, the new experiment ID is '.$import_flag.'.');
              }else{
                  return array('status'=&gt;1, 'message'=&gt;'File has been successfully imported, Experiment'.$import_flag.' has been updated.');
              }
          }else{//validation ok, import fail
              return array('status'=&gt;2, 'message'=&gt;'Something went wrong during the process of importing, please try again.');
          }
      }else{
          //return experiment with errors which are to be presented in view
          $return_error = array();
          $return_warning = array();
          foreach($experiment as $name =&gt; $sheet){
              if(isset($sheet['validation'])){
                  foreach ($sheet['validation']['error'] as $item){
                      array_push($return_error, $item);
                  }
                  foreach($sheet['validation']['warning'] as $item){
                      array_push($return_warning, $item);
                  }
              }
          }
          //if(!empty($temp_interval_match_error)){   array_push($return_error, $temp_interval_match_error); }
          return array('status'=&gt;3, 'message'=&gt;'The file has invalid cells, please correct the file according to the following hints.',
                      'error' =&gt; $return_error, 'warning'=&gt;$return_warning);
      }
  }//end of fn do_import()
  </code></pre>
  
  <p>Please help to locate the problem. Many thanks in advance.</p>