Title: PHP 7.0.8 throws trim error
Last modified: September 1, 2016

---

# PHP 7.0.8 throws trim error

 *  [scottgruber](https://wordpress.org/support/users/guyniche/)
 * (@guyniche)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-708-throws-trim-error/)
 * Hi,
    I ran into an error after updating the plugin to ver 1.5.1 on a server running
   php 7.0.8 when I enter an email to subscriber a user. I tested with all other
   plugins turned off and got the same error. I didn’t throw the error when running
   PHP 5.6.
 *     ```
       Warning: trim() expects parameter 1 to be string, array given in
       */wp-content/plugins/mailchimp/mailchimp.php on line 909
       ```
   
 * When I add an **is_string** check the error is fixed. So if I go
 * from
 *     ```
       else if (!is_object($v) && trim($v) === '')
       ```
   
 * to
 *     ```
       else if (!is_object($v) && is_string($v) && trim($v) === '')
       ```
   
 * Can you please check if my syntax is correct and if so merge a fix.
 * Thanks!
 * [https://wordpress.org/plugins/mailchimp/](https://wordpress.org/plugins/mailchimp/)

Viewing 1 replies (of 1 total)

 *  [mc_nate](https://wordpress.org/support/users/mc_nate/)
 * (@mc_nate)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-708-throws-trim-error/#post-7592900)
 * Ah!
 * Thanks Scott. I’ll get this implemented for the next bugfix we push out.

Viewing 1 replies (of 1 total)

The topic ‘PHP 7.0.8 throws trim error’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp/assets/icon.svg?rev=3156997)
 * [Mailchimp List Subscribe Form](https://wordpress.org/plugins/mailchimp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [mc_nate](https://wordpress.org/support/users/mc_nate/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/php-708-throws-trim-error/#post-7592900)
 * Status: not resolved