Answers.Body: <p>You are using quite older version of CiviCRM, I would recommend you to upgrade CiviCRM to 4.7.31 or 5.2.1 rather fixing core code to handle php7. The newer version does support php7. And also since 4.7.7 there has been many security releases(since you had malicious attack) and includes many fixes.</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-18T00:05:25.443Z
Answers.Text: No- don't upgrade to 4.7.31 - if you are upgrading upgrade to 5.2.1 - 4.7.31 is not the latest version in any major version. 4.7 & 5.x are the same 'major version'
Answers.UserDisplayName: user4278
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-16T08:02:26.373Z
Answers.LastActivityDate: 2018-06-16T08:02:26.373Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Our volunteer group uses Civicrm. It runs under Drupal. We host with ..(cough cough) Godaddy. Recently their Cpanel automatically switched us from PHP 5.4 to 7 and our Civicrm 4.7.7 crashed with errors.</p>
  
  <p>To cut a long story short after their techs told us it was a malicious attack, and we went into melt down changing passwords etc, we find it was simply the PHP version change.</p>
  
  <p>So back on topic, we had our Civi working fine under 5.4php and after the crash we went back from PHP 7 to 5.4. Now just one of our reports throws an error:</p>
  
  <p><strong>Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in at line 304</strong></p>
  
  <p>Here is the code around line 304</p>
  
  <p>),
        'civicrm_membership' => array(
          'dao' => CRM_Member_DAO_Membership::class,
          'fields' => array(
            'membership_status' => array(
              'title' => ts('Membership Status'),
              'name' => 'status_id',
              'default' => TRUE,</p>
  
  <p>This is line 304 specifically: <strong>'dao' => CRM_Member_DAO_Membership::class,</strong></p>
  
  <p>After doing some reading i found a statement that the use of the word class in php is a reserved word and shouldn't be used. Not really sure what that means. However Our report that was working no longer works.</p>
  
  <p>Am i missing maybe a duplicate here or is it something more than i can handle?</p>
  
  <p>Cheers and Gday from Australia</p>
  
Tags: <civireport>
Title: Parse error just appeared
ThreadText: # Parse error just appeared
  
  (Asked by: username_0 on 2018-06-16)
  
  Our volunteer group uses Civicrm. It runs under Drupal. We host with ..(cough cough) Godaddy. Recently their Cpanel automatically switched us from PHP 5.4 to 7 and our Civicrm 4.7.7 crashed with errors.
  
  To cut a long story short after their techs told us it was a malicious attack, and we went into melt down changing passwords etc, we find it was simply the PHP version change.
  
  So back on topic, we had our Civi working fine under 5.4php and after the crash we went back from PHP 7 to 5.4. Now just one of our reports throws an error:
  
  **Parse error: syntax error, unexpected 'class' (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or '{' or '$' in at line 304**
  
  Here is the code around line 304
  
  ),
  'civicrm\_membership' => array(
  'dao' => CRM\_Member\_DAO\_Membership::class,
  'fields' => array(
  'membership\_status' => array(
  'title' => ts('Membership Status'),
  'name' => 'status\_id',
  'default' => TRUE,
  
  This is line 304 specifically: **'dao' => CRM\_Member\_DAO\_Membership::class,**
  
  After doing some reading i found a statement that the use of the word class in php is a reserved word and shouldn't be used. Not really sure what that means. However Our report that was working no longer works.
  
  Am i missing maybe a duplicate here or is it something more than i can handle?
  
  Cheers and Gday from Australia
  
  **Tags:** civireport
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-16. Score: 1
  
  You are using quite older version of CiviCRM, I would recommend you to upgrade CiviCRM to 4.7.31 or 5.2.1 rather fixing core code to handle php7. The newer version does support php7. And also since 4.7.7 there has been many security releases(since you had malicious attack) and includes many fixes.
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_2**: No- don't upgrade to 4.7.31 - if you are upgrading upgrade to 5.2.1 - 4.7.31 is not the latest version in any major version. 4.7 & 5.x are the same 'major version'  
  
  ---
  
  