Title: Array To String conversion Warning (PHP 8.0)
Last modified: March 8, 2022

---

# Array To String conversion Warning (PHP 8.0)

 *  Resolved [jackigmail](https://wordpress.org/support/users/jackigmail/)
 * (@jackigmail)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/)
 * Am using the latest version of Easy WP SMTP, Version 1.4.7
    Recently moved from
   PHP 7.4 to PHP 8.0. Am now seeing this warning in debug.log file:
 * Warning: Array to String Conversion… easy-wp-smtp/easy-wp-smtp.php: line 75
 * Has anyone else seeing this error?

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

 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15439808)
 * Thank you for reaching out to us. I have submitted a message to the developers
   to investigate further your issue.
 * Kind regards.
 *  [wp.insider](https://wordpress.org/support/users/wpinsider-1/)
 * (@wpinsider-1)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15440477)
 * Looks like the email “Subject” field’s value may have some incorrect formatting.
   So it’s creating this notice in PHP 8 (PHP 7 was ignoring it).
 * What is the subject line of the email in question? The email that produces that
   notice.
 *  Thread Starter [jackigmail](https://wordpress.org/support/users/jackigmail/)
 * (@jackigmail)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15449765)
 * It was the To: field that had the array.
    I changed this line: $line = sprintf(‘
   Headers: %s, To: %s, Subject: %s’, ! empty( $args[‘headers’] && is_array( $args[‘
   headers’] ) ) ? implode( ‘ | ‘, $args[‘headers’] ) : ”, ! empty( $args[‘to’] ):”,!
   empty( $args[‘subject’] ) ? $args[‘subject’] : ” );
 * To this:
    $line = sprintf( ‘Headers: %s, To: %s, Subject: %s’, ! empty( $args[‘
   headers’] && is_array( $args[‘headers’] ) ) ? implode( ‘ | ‘, $args[‘headers’]):”,!
   empty( $args[‘to’] && is_array( $args[‘to’] ) ) ? implode( ‘ ; ‘, $args[‘to’]):”,!
   empty( $args[‘subject’] ) ? $args[‘subject’] : ” );
 * And the Warning no longer occurs.
    Thank you.
 *  [wp.insider](https://wordpress.org/support/users/wpinsider-1/)
 * (@wpinsider-1)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15451849)
 * That looks good but it doesn’t cover one scenario where the “to” field is not
   an array.
 * I have made a change to the plugin that should handle this. Please download the
   following copy of the plugin and test it out.
 * [https://wp-ecommerce.net/wp-content/uploads/plugin-downloads/easy-wp-smtp.zip](https://wp-ecommerce.net/wp-content/uploads/plugin-downloads/easy-wp-smtp.zip)
 * Let me know how that goes.
 *  Thread Starter [jackigmail](https://wordpress.org/support/users/jackigmail/)
 * (@jackigmail)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15454210)
 * Works just perfect. Thank you.

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

The topic ‘Array To String conversion Warning (PHP 8.0)’ is closed to new replies.

 * ![](https://ps.w.org/easy-wp-smtp/assets/icon.svg?rev=3158017)
 * [Easy WP SMTP – WordPress SMTP and Email Logs: Gmail, Office 365, Outlook, Custom SMTP, and more](https://wordpress.org/plugins/easy-wp-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-wp-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-wp-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-wp-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-wp-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-wp-smtp/reviews/)

## Tags

 * [PHP 8.0](https://wordpress.org/support/topic-tag/php-8-0/)

 * 5 replies
 * 3 participants
 * Last reply from: [jackigmail](https://wordpress.org/support/users/jackigmail/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/array-to-string-conversion-warning-php-8-0/#post-15454210)
 * Status: resolved