Title: PHP Warning on /wp-cache-phase2.php
Last modified: September 27, 2024

---

# PHP Warning on /wp-cache-phase2.php

 *  Resolved [dwxd](https://wordpress.org/support/users/dwxd/)
 * (@dwxd)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/)
 * Anyone else getting this PHP warning?
 * PHP Warning: Attempt to read property “ID” on int in /wp-content/plugins/wp-super-
   cache/wp-cache-phase2.php on line 3411′

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

 *  Plugin Support [Alin (a11n)](https://wordpress.org/support/users/alinclamba/)
 * (@alinclamba)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18051451)
 * Hi [@dwxd](https://wordpress.org/support/users/dwxd/),
 * Thanks for reaching out! Could you share a few details to help us investigate?
    1. WordPress and PHP versions
    2. WP Super Cache version
    3. Any recent changes to your site (updates, new plugins, etc.)
 * Let me know so we can look into this further!
 *  Thread Starter [dwxd](https://wordpress.org/support/users/dwxd/)
 * (@dwxd)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18051598)
 * Hi [@alinclamba](https://wordpress.org/support/users/alinclamba/),
 * Thanks for getting back to me on this.
 * **PHP Version:** 8.3.7
   **WordPress Version:** 6.6.2**WP Super Cache Version:**
   1.12.4
 * The main change we have done recently was update to the latest version of PHP,
   however this warning isn’t getting shown on our other sites which are using the
   same PHP version, so can’t be that?
 * We’ve uninstalled the plugin and re-installed it with a fresh clean set of instructions,
   but still is coming up with the warning unfortunately.
 * Maybe you can go into details into what this file is/does?
 * /wp-cache-phase2.php
 * Thanks
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18057510)
 * It’s in a function called wp_cache_post_id() which should return the ID of the
   post being displayed. Do you see this warning happen when you’re displaying single
   posts?
 * Are you modifying the [global $posts variable](https://codex.wordpress.org/Global_Variables)
   on this website? The line that’s causing the warning uses that variable.
 * It might be worth investigating that bit of code by dumping $posts to error_log()
   to make sure it does have “$posts[0]->ID”.
 *  Plugin Support [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18072253)
 * Hi there, [@dwxd](https://wordpress.org/support/users/dwxd/),
 * Do you have updates about that, do you still need help? We usually close inactive
   threads after one week of no movement, but we want to make sure we’re all set
   before marking it as solved. Thanks!
 *  Thread Starter [dwxd](https://wordpress.org/support/users/dwxd/)
 * (@dwxd)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18073559)
 * Hi [@donncha](https://wordpress.org/support/users/donncha/) and [@erania-pinnera](https://wordpress.org/support/users/erania-pinnera/),
 * We are still getting this strange error 🙁
 * We are not modifying the **global $posts variable**.
 * After dumping the $posts array, the **ID **is always getting populated, here 
   is the full array in-case you can spot anything else going on which WP Super 
   Cache might not like:
 *     ```wp-block-code
       array(1) { [0]=> object(WP_Post)#2504 (24) { ["ID"]=> int(24137) ["post_author"]=> string(2) "12" ["post_date"]=> string(19) "2024-05-08 12:58:11" ["post_date_gmt"]=> string(19) "2024-05-08 11:58:11" ["post_content"]=> string(0) "" ["post_title"]=> string(55) "Apple's New iPad Pro - The Ultimate Portable Powerhouse" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(52) "apples-new-ipad-pro-the-ultimate-portable-powerhouse" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2024-06-13 14:56:45" ["post_modified_gmt"]=> string(19) "2024-06-13 13:56:45" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(38) "https://www.loveitcoverit.com/?p=24137" ["menu_order"]=> int(0) ["post_type"]=> string(4) "post" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } }
       ```
   
 * Also from my understanding this is only going to impact the **single.php**? “
   blog” section and not the main “pages” (**page.php**) section of our website?
 * Thanks
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18076632)
 * Thanks for checking. It should only happen on single posts on your website, but
   that can include pages. It won’t happen on archive pages or your homepage.
 * Did you see the error_log dump out that sort of array at the same time the warning
   showed in your error_log? Does the warning happen very often? I think it would
   be worth including the URL in the error_log too ($_SERVER[‘REQUEST_URI’]) so 
   you’ll know what page the problem is happening on. It might well be a plugin 
   or your theme interacting with the posts array on a particular page that’s causing
   the problem.
 *  Plugin Support [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18092635)
 * Hey [@dwxd](https://wordpress.org/support/users/dwxd/),
 * Do you have updates about that, do you still need help? We usually close inactive
   threads after one week of no movement, but we want to make sure we’re all set
   before marking it as solved. Thanks!
 *  Thread Starter [dwxd](https://wordpress.org/support/users/dwxd/)
 * (@dwxd)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18095549)
 * Hey [@erania-pinnera](https://wordpress.org/support/users/erania-pinnera/),
 * Sorry, yes we are still seeing this issue happening, and trying to pin point 
   exactly what is going on.
 * On our development site i am testing out more of a error handler to get more 
   information as suggested, hopefully be able to put this in place on our production
   environment soon to nail this.
 * I’ll let you know what this tells me.
 * Out of curiosity, this seems like a “only us” kind of bug, has anyone else flagged
   something similar to this in the past?
 * Thanks
 *  [Chatoxz (a11n)](https://wordpress.org/support/users/chatoxz/)
 * (@chatoxz)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18105792)
 * Hello there,
    Sebastian from Jetpack here. I hope you are doing well.
 * It seems like this issue might be specific to your setup, as we cannot find any
   other reports of this.
 * It’s a good idea to continue with the error handler to gather more information.
   Including the URL in the error log, as suggested, can help identify if a specific
   page or plugin is causing the issue.
 * Please keep us updated on your findings.
 * Thank you!
 *  Plugin Support [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18119309)
 * Hi there [@dwxd](https://wordpress.org/support/users/dwxd/),
 * Do you have any more news to share with us? How did the further testing go?
 * As mentioned, we usually close threads after one week of inactivity 🙂

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

The topic ‘PHP Warning on /wp-cache-phase2.php’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

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

 * 10 replies
 * 5 participants
 * Last reply from: [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/php-warning-on-wp-cache-phase2-php/#post-18119309)
 * Status: resolved