Title: Array to string conversion in execute-cache.php:1039 (breeze_commented_posts)
Last modified: October 6, 2026

---

# Array to string conversion in execute-cache.php:1039 (breeze_commented_posts)

 *  [webnovelty](https://wordpress.org/support/users/webnovelty/)
 * (@webnovelty)
 * [1 day, 7 hours ago](https://wordpress.org/support/topic/array-to-string-conversion-in-execute-cache-php1039-breeze_commented_posts/)
 * Hello,
 * We see this warning in the PHP error log of a site running Breeze 2.6.1 (it was
   the same on 2.6.0):
 *     ```wp-block-code
       PHP Warning:  Array to string conversion in .../wp-content/plugins/breeze/inc/cache/execute-cache.php on line 1039
       ```
   
 * Cause: `Breeze_Execute_Cache::get_wp_logged_in_cookie_value()` loops over every
   cookie and casts the value to a string before checking the cookie name:
 *     ```wp-block-code
       foreach ( $_COOKIE as $cookie_name => $cookie_value ) {
           $cookie_name  = (string) $cookie_name;
           $cookie_value = (string) $cookie_value;   // line 1039
           // the wordpress_logged_in_ name check comes only after this
       ```
   
 * Breeze itself sets the cookie `breeze_commented_posts[<post_id>]` for visitors
   who left a comment (`inc/cache/purge-cache.php`, line 174), and reads it back
   as an array in `execute-cache.php` (line 977). PHP parses a cookie name with 
   square brackets into an array, so `$_COOKIE['breeze_commented_posts']` is an 
   array, and the cast on line 1039 raises the warning when such a visitor opens
   a page.
 * Steps to reproduce:
    1. Enable page cache in Breeze.
    2. Leave a comment as a guest on any post, so the browser gets `breeze_commented_posts[
       123]`.
    3. Open any page: the warning appears in the PHP error log.
 * Suggested fix: skip non-string values before the cast, or check the name first,
   for example:
 *     ```wp-block-code
       foreach ( $_COOKIE as $cookie_name => $cookie_value ) {
           if ( ! is_string( $cookie_value ) ) {
               continue;
           }
           $cookie_name = (string) $cookie_name;
       ```
   
 * The value of such a cookie can never be a `wordpress_logged_in_` cookie anyway,
   so skipping it does not change the behaviour of the check.
 * Thank you.

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

 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [20 hours, 17 minutes ago](https://wordpress.org/support/topic/array-to-string-conversion-in-execute-cache-php1039-breeze_commented_posts/#post-19038544)
 * Thanks for the report.
 * When a guest leaves a comment, Breeze sets a cookie named `breeze_commented_posts[
   123]`, which PHP reads as an array. On the next page view, the function `get_wp_logged_in_cookie_value()`
   converts every cookie value to a string before checking the cookie name. That
   causes the “Array to string conversion” notice on line 1039 of `execute-cache.
   php`.
 * This doesn’t affect caching, and it isn’t visible on the front end when `WP_DEBUG_DISPLAY`
   is off. It only shows up in the PHP error log.
 * We’re looking into how to handle non-text cookie values in that check. Thanks
   for helping us track this down.
 *  Thread Starter [webnovelty](https://wordpress.org/support/users/webnovelty/)
 * (@webnovelty)
 * [20 hours, 1 minute ago](https://wordpress.org/support/topic/array-to-string-conversion-in-execute-cache-php1039-breeze_commented_posts/#post-19038572)
 * Thanks for confirming. We will test the next release on our staging site (guest
   comment, then a page view) and report back here.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Farray-to-string-conversion-in-execute-cache-php1039-breeze_commented_posts%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/breeze/assets/icon-256x256.gif?rev=3352595)
 * [Breeze Cache](https://wordpress.org/plugins/breeze/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/breeze/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/breeze/)
 * [Active Topics](https://wordpress.org/support/plugin/breeze/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breeze/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breeze/reviews/)

## Tags

 * [cookie](https://wordpress.org/support/topic-tag/cookie/)
 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 2 replies
 * 2 participants
 * Last reply from: [webnovelty](https://wordpress.org/support/users/webnovelty/)
 * Last activity: [20 hours, 1 minute ago](https://wordpress.org/support/topic/array-to-string-conversion-in-execute-cache-php1039-breeze_commented_posts/#post-19038572)
 * Status: not resolved