Title: Eliminate PHP warning
Last modified: June 10, 2021

---

# Eliminate PHP warning

 *  Resolved [Yworld](https://wordpress.org/support/users/yworld/)
 * (@yworld)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/eliminate-php-warning/)
 * Hello.
    Trying to fix the php 8 warning. File powered-cache/ includes/functions.
   php line 227(PHP Warning: Undefined array key “path”): `$sub_dir = $url_info['
   host'] . $url_info['path'];`
 * Replace:
    `$sub_dir = $url_info['host'] . ( isset($url_info['path']) ? $url_info['
   path'] : '' );`
 * It seems to work, but I don’t know if this is correct or not?
    -  This topic was modified 4 years, 12 months ago by [Yworld](https://wordpress.org/support/users/yworld/).

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

 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/eliminate-php-warning/#post-14540598)
 * Hi [@yworld](https://wordpress.org/support/users/yworld/),
 * That makes sense, I think `path` does not exist when the given URL exactly matches
   the host (without trailingslash), PHP 8 might change notices to warning when 
   you try to access a non-existing key, because `parse_url` used to be working 
   as before.
 * I will fix this in the next version but there is no ETA yet.
 * Thanks for reporting,
 *  Thread Starter [Yworld](https://wordpress.org/support/users/yworld/)
 * (@yworld)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/eliminate-php-warning/#post-14540612)
 * [@m_uysl](https://wordpress.org/support/users/m_uysl/)
    Thanks, great news!
 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/eliminate-php-warning/#post-14807464)
 * [@yworld](https://wordpress.org/support/users/yworld/) This has been addressed
   in the new version (2.0) of the Powered Cache. Thanks for the feedback.

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

The topic ‘Eliminate PHP warning’ is closed to new replies.

 * ![](https://ps.w.org/powered-cache/assets/icon.svg?rev=2796939)
 * [Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score](https://wordpress.org/plugins/powered-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/powered-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/powered-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/powered-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/powered-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/powered-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/eliminate-php-warning/#post-14807464)
 * Status: resolved