Title: PHP 8.2 Issue
Last modified: April 8, 2024

---

# PHP 8.2 Issue

 *  Resolved Anonymous User
 * (@anonymized-20115841)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/)
 * HTTP_USER_AGENT unknown
 * Solution:
 *     ```wp-block-code
       if ((!empty($_SERVER['HTTP_USER_AGENT'])) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9.') !==false)) {
           return $tag;
       } else {
           return str_replace(' src',' defer src', $tag);
       }
       ```
   

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

 *  Plugin Author [Fernando Tellado](https://wordpress.org/support/users/fernandot/)
 * (@fernandot)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17560502)
 * Thanks @dbase66 I’ll test it, I didn’t tested it with 8.2 🙂
 *  Thread Starter Anonymous User
 * (@anonymized-20115841)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17563676)
 * its my solution with php 8.2 and it works
 *  Plugin Author [Fernando Tellado](https://wordpress.org/support/users/fernandot/)
 * (@fernandot)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17677982)
 * I’ve tested the plugin with PHP 8.2 and it works
 * What issue did you noticed with the actual version and PHP 8.2?
 *  Thread Starter Anonymous User
 * (@anonymized-20115841)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17680638)
 * This is the latest official Version:
 * if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘MSIE 9.’) !==false) {
   return $tag;} 
   else {return str_replace(‘ src’,’ defer src’, $tag);}
 * IF $_SERVER[‘HTTP_USER_AGENT’] is NULL, then your Code throws error message in
   8.2
 *  Plugin Author [Fernando Tellado](https://wordpress.org/support/users/fernandot/)
 * (@fernandot)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17680644)
 * Ok,i’ll change it for the next version
 * Thanks

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

The topic ‘PHP 8.2 Issue’ is closed to new replies.

 * ![](https://ps.w.org/wpo-tweaks/assets/icon-256x256.jpg?rev=3567304)
 * [DietPress](https://wordpress.org/plugins/wpo-tweaks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpo-tweaks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpo-tweaks/)
 * [Active Topics](https://wordpress.org/support/plugin/wpo-tweaks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpo-tweaks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpo-tweaks/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Fernando Tellado](https://wordpress.org/support/users/fernandot/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/php-8-2-issue-4/#post-17680644)
 * Status: resolved