Title: Fatal error: Can&#8217;t use function return value
Last modified: April 11, 2017

---

# Fatal error: Can’t use function return value

 *  Resolved [sigersmit](https://wordpress.org/support/users/sigersmit/)
 * (@sigersmit)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/)
 * Hi,
 * Great that you have implemented the invisible re-captcha. Updating didn’t work,
   had to delete and reinstall. One one site all ok, on one other I’ve got this 
   error message:
 * Fatal error: Can’t use function return value in write context in mysite/wp-content/
   plugins/uber-nocaptcha-recaptcha/includes/class-ncr-captcha-on-comment-form.php
   on line 40
 * What’s wrong?
 * Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Steve Hogan](https://wordpress.org/support/users/stevehoganstevehogancom/)
 * (@stevehoganstevehogancom)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9021068)
 * I commented out lines 40-42 in the file as a temporary workaround to get my site
   back on line. I THINK this only affects the wordpress comment form which I am
   not using. Hope this helps until the author gets this fixed.
 * These are the lines I commented.
 * // if ( !empty( array_intersect( $plugin_option[‘show_logged_users’], $current_user_roles))){
   //
   return new NCR_captcha_on_comment_form(); // }
 * Steve Hogan
 *  [Steve Hogan](https://wordpress.org/support/users/stevehoganstevehogancom/)
 * (@stevehoganstevehogancom)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9021134)
 * More .. I replaced the three lines I commented out above with this code:
 *  $test_array = array_intersect( $plugin_option[‘show_logged_users’], $current_user_roles);
   
   if (!empty($test_array)){ return new NCR_captcha_on_comment_form(); }
 * And it no longer blows up FWIW. (Whether it actually behaves as the author intended
   is TBD.)
 * I believe this has something to do with the behavior of “empty” in different 
   versions of PHP. My site is on PHP 5.6.30.
 *  [Macho Themes](https://wordpress.org/support/users/machothemes/)
 * (@machothemes)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9021976)
 * Hi guys,
 * yep. It looks to be an issue with how PHP empty values are handled across different
   versions. We’ve tested on PHP 7.x and it’s working absolutely fine. Just FYI –
   WordPress recommends PHP 7.1 as a minimum. [https://wordpress.org/about/requirements/](https://wordpress.org/about/requirements/)
 * We’ll look into this see if we can find the culprit. In the meantime, please 
   update your PHP version as per WP requirements.
 * Thanks,
    Cristian.
 *  Thread Starter [sigersmit](https://wordpress.org/support/users/sigersmit/)
 * (@sigersmit)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9022149)
 * Thanks Steve. I’ll see if my host can upgrade to PHP 7.
 *  [Steve Hogan](https://wordpress.org/support/users/stevehoganstevehogancom/)
 * (@stevehoganstevehogancom)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9027157)
 * [@sigersmit](https://wordpress.org/support/users/sigersmit/) – You are most welcome
 * [@cristian](https://wordpress.org/support/users/cristian/) – You are 100% right,
   of course, about moving to PHP7. However, some hosting companies make this difficult
   for the user to initiate. Also, I’m planning on moving all of my sites to PHP7(
   I run 20+ sites, most with very little traffic) and I fully expect something 
   to blow up – probably a few plugins 🙂
 * Thanks for looking at this. I appreciate your hard work.
 * S
 *  [Macho Themes](https://wordpress.org/support/users/machothemes/)
 * (@machothemes)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9027368)
 * [@stevehoganstevehogancom](https://wordpress.org/support/users/stevehoganstevehogancom/)–
   PHP7 has good backwards compatible with older versions. Nothing should break.
   I’ve already put it on the to-do list for the team to make sure this plugin is
   backwards compatible down to PHP 5.4
 * Thanks,
    Cristian.
 *  [Steve Hogan](https://wordpress.org/support/users/stevehoganstevehogancom/)
 * (@stevehoganstevehogancom)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9028111)
 * Superb. Can’t ask for anything more. Let me know if I can help in any way.
 * S

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Fatal error: Can’t use function return value’ is closed to new replies.

 * ![](https://ps.w.org/uber-nocaptcha-recaptcha/assets/icon-256x256.png?rev=2985656)
 * [Uber reCaptcha](https://wordpress.org/plugins/uber-nocaptcha-recaptcha/)
 * [Support Threads](https://wordpress.org/support/plugin/uber-nocaptcha-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/uber-nocaptcha-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/uber-nocaptcha-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/uber-nocaptcha-recaptcha/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Steve Hogan](https://wordpress.org/support/users/stevehoganstevehogancom/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-3/#post-9028111)
 * Status: resolved