Answers.Body: <p>Line 435 in CRM/Export/BAO/Export.php that your error message is referring to says:</p>
  
  <pre><code>if (!empty(self::defaultReturnProperty($exportMode))) {
  </code></pre>
  
  <p>This will give an error in all PHP versions below 5.5. From the PHP manual (<a href="http://php.net/manual/en/function.empty.php">http://php.net/manual/en/function.empty.php</a>):</p>
  
  <blockquote>
    <p>Prior to PHP 5.5, empty() only supports variables; anything else will
    result in a parse error</p>
  </blockquote>
  
  <p>You should be able to fix this by replacing lines 435-437 in Export.php with something like</p>
  
  <pre><code>  $key = self::defaultReturnProperty($exportMode);
    if ($key) {
      $returnProperties[$key] = 1;
    }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-22T07:32:50.903Z
Answers.Text: Yes!  That fixed it. Thanks very much for your help. :-)  :-)
Answers.UserDisplayName: Davy Ivins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-22T09:10:16.243Z
Answers.Text: I keep running afoul of this because my laptop has a later version of PHP than my live server.
Answers.UserDisplayName: DaveFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-29T16:06:28.590Z
Answers.Text: Should this be considered a bug?  Is it already set up?
Answers.UserDisplayName: G H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-31T09:14:05.703Z
Answers.Text: I have reported this in the CiviCRM issue queue at https://issues.civicrm.org/jira/browse/CRM-18279 so it will hopefully be fixed in the next version.
Answers.UserDisplayName: reswild
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-21T22:11:27.573Z
Answers.LastActivityDate: 2016-03-21T22:11:27.573Z
Answers.UserDisplayName: reswild
Body: <p>I have just upgraded my Drupal 6 site to the latest CiviCRM 4.7.4 
  All seemed to go well except that when I try to export contact records (using primary fields). I get the following fatal error:</p>
  
  <p>Fatal error: Can't use function return value in write context in ../public_html/sites/all/modules/civicrm/CRM/Export/BAO/Export.php on line 435</p>
  
  <p>Steps I followed:
  1. Search for contacts
  2. Select Export option
  3. Select Export Primary fields
  4. Press continue</p>
  
  <p>Some help would be hugely appreciated!</p>
  
  <p>Thanks
  Davy</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-19T17:11:26.007Z
Comments.Text: This is a good question!  To solve your problem, we'll need to see the expanded debugging information.  In CiviCRM, please go to **Administer menu > System Settings > Debugging and Error Handling**, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save".  Repeat the problem that caused your error, and you'll see much a much more detailed error.  Please update this question with the expanded error and backtrace - and don't forget to disable debugging/backtrace when you're done!
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-21T09:27:10.060Z
Comments.Text: I enabled the debug settings as suggested but still only get the one line error. No backtrace info at all. I cleared caches, switched off drupal caching, cleared Civi caches, deleted content of templates_c directory, tried in Chrome and Safari... but still only the one line. :-(
Comments.UserDisplayName: Davy Ivins
Tags: <4.7><export><drupal-6>
Title: Help: Fatal error doing an export (Civi 4.7.4)
ThreadText: # Help: Fatal error doing an export (Civi 4.7.4)
  
  (Asked by: username_0 on 2016-03-19)
  
  I have just upgraded my Drupal 6 site to the latest CiviCRM 4.7.4
  All seemed to go well except that when I try to export contact records (using primary fields). I get the following fatal error:
  
  Fatal error: Can't use function return value in write context in ../public\_html/sites/all/modules/civicrm/CRM/Export/BAO/Export.php on line 435
  
  Steps I followed:
  1. Search for contacts
  2. Select Export option
  3. Select Export Primary fields
  4. Press continue
  
  Some help would be hugely appreciated!
  
  Thanks
  username_0
  
  **Tags:** 4.7, export, drupal-6
  
  > **Comments:**
  > **username_1**: This is a good question!  To solve your problem, we'll need to see the expanded debugging information.  In CiviCRM, please go to **Administer menu > System Settings > Debugging and Error Handling**, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save".  Repeat the problem that caused your error, and you'll see much a much more detailed error.  Please update this question with the expanded error and backtrace - and don't forget to disable debugging/backtrace when you're done!  
  > **username_0**: I enabled the debug settings as suggested but still only get the one line error. No backtrace info at all. I cleared caches, switched off drupal caching, cleared Civi caches, deleted content of templates_c directory, tried in Chrome and Safari... but still only the one line. :-(  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-03-21. Score: 6 | Accepted answer
  
  Line 435 in CRM/Export/BAO/Export.php that your error message is referring to says:
  
  ```
  if (!empty(self::defaultReturnProperty($exportMode))) {
  
  ```
  
  This will give an error in all PHP versions below 5.5. From the PHP manual (<http://php.net/manual/en/function.empty.php>):
  
  > Prior to PHP 5.5, empty() only supports variables; anything else will
  > result in a parse error
  
  You should be able to fix this by replacing lines 435-437 in Export.php with something like
  
  ```
    $key = self::defaultReturnProperty($exportMode);
    if ($key) {
      $returnProperties[$key] = 1;
    }
  
  ```
  
  > **Comments:**
  > **username_0**: Yes!  That fixed it. Thanks very much for your help. :-)  :-)  
  > **username_3**: I keep running afoul of this because my laptop has a later version of PHP than my live server.  
  > **username_4**: Should this be considered a bug?  Is it already set up?  
  > **username_2**: I have reported this in the CiviCRM issue queue at https://issues.civicrm.org/jira/browse/CRM-18279 so it will hopefully be fixed in the next version.  
  
  ---
  
  