Title: PHP8.1 deprected functions
Last modified: December 15, 2022

---

# PHP8.1 deprected functions

 *  [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/)
 * I just updated to PHP 8.1 and get PHP deprecated errors since:
 *     ```wp-block-code
       Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.php on line 7022
   
       Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-includes/functions.php on line 2162
   
       Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.php on line 7022
   
       Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-includes/functions.php on line 2162
   
       Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.php on line 7022
   
       Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-includes/functions.php on line 2162
   
       Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.php on line 7022
   
       Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-includes/functions.php on line 2162
       ```
   
 * These errors appears on every admin page but never on frontpages. If I deactivate
   OceanWP, no error anymore reported. If I downgrade PHP to 8.0, no error reported
   anymore.
 * Could you look at what is causing the issue? Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp8-1-deprected-functions%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Shahin](https://wordpress.org/support/users/skalanter/)
 * (@skalanter)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16295387)
 * Hello [@psykonevro](https://wordpress.org/support/users/psykonevro/),
 * Thanks for reaching out and letting us know.
 * We did see this happening on our end, so we’ll share this topic with the developer
   team, and it will be fixed/improved for the next updates.
 * Note: Actually, it’s just a warning, and it does not hurt your website, but thank
   you for your report. This topic has been forwarded to the developer team to fix
   in the next updates. You can turn off your WordPress debugger to hide it: [https://wordpress.org/support/article/debugging-in-wordpress/#wp_debug](https://wordpress.org/support/article/debugging-in-wordpress/#wp_debug).
 * I appreciate your patience until the issues are resolved.
 * Best Regards
    -  This reply was modified 3 years, 5 months ago by [Shahin](https://wordpress.org/support/users/skalanter/).
 *  Thread Starter [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16295943)
 * thanks! Looking forward to the fix.
 * (Thanks for the WP debugging option, but it is a developpment wordpress environment
   I use)
    -  This reply was modified 3 years, 5 months ago by [JCV](https://wordpress.org/support/users/psykonevro/).
 *  [Marko OceanWP](https://wordpress.org/support/users/wpfleek/)
 * (@wpfleek)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16308826)
 * Hi [@psykonevro](https://wordpress.org/support/users/psykonevro/),
 * Thanks for reaching out.
 * In regards to your report – I had the same issue but it was related to my localhost
   environment. A live server with the same PHP configuration didn’t throw these
   errors even though the PHP version was the same: 7.4.
 * We tested with Laragon and PHP 8.1.8 and no similar issues, and also nothing 
   on live sites.
 * Can you please share more info about your development environment (for example,
   I had issues only on XAMPP), as well as the exact PHP version.
 * Thank you very much for your time
 *  Thread Starter [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16310062)
 * hi [@wpfleek](https://wordpress.org/support/users/wpfleek/)
 * Here some further infos about my environment (the WP block-based is terrible 
   for pasting info) let me know if you need further info. I deactivated all plugins,
   bu no difference.
 * Server architectureLinux 4.9.0-0.bpo.12-amd64 x86_64
 * Web serverApachePHP version8.1.12 (Supports 64bit values)
 * PHP SAPIfpm-fcgi
 * PHP max input variables3000
 * PHP time limit60
 * PHP memory limit1024M
 * Max input time0
 * Upload max filesize400M
 * PHP post max size400M
 * cURL version7.74.0
 * OpenSSL/1.1.1kIs
 * SUHOSIN installed?No
 * Is the Imagick library available?Yes
 * Are pretty permalinks supported?Yes
 * .htaccess rules
 * Custom rules have been added to your .htaccess file.
 *  [Marko OceanWP](https://wordpress.org/support/users/wpfleek/)
 * (@wpfleek)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16347092)
 * Hi [@psykonevro](https://wordpress.org/support/users/psykonevro/),
 * Happy New Year!
 * Thanks for your patience.
 * After much investigation, including fresh new installations with default themes,
   we came to the conclusion some of those errors come from WordPress Core.
 * Example, this is on WP 6.1.1 with only the TwentyTwenty theme enabled and no 
   actions taken:
    `[25-Dec-2022 16:25:11 UTC] PHP Deprecated: stripos(): Passing
   null to parameter #1 ($haystack) of type string is deprecated in D:\xampp\htdocs\
   oceanwp_test\wp-includes\functions.wp-styles.php on line 90`
 * My colleague got similar ones with 6.1.1 and the latest 2023 theme, but these
   were about strpos() and trim().
 * In regards to WP Core, PHP 8.1 and Cookie Jar errors, please see the following
   topic: [https://wordpress.org/support/topic/deprecated-return-type-of-requests_utility/](https://wordpress.org/support/topic/deprecated-return-type-of-requests_utility/)
 * However, there were some issues with Ocean Extra files for backwards compatibility
   for the old Panel (Theme Panel), and we have addressed those in the dev versions.
   If you can please give them a spin on a test site, that would be great:
    [https://github.com/oceanwp/ocean-extra/tree/oe-2.1.0-rc](https://github.com/oceanwp/ocean-extra/tree/oe-2.1.0-rc)
   [https://github.com/oceanwp/oceanwp/tree/owp-3.4.0-rc](https://github.com/oceanwp/oceanwp/tree/owp-3.4.0-rc)
 * As for all other issues listed above, that needs to be addressed through the 
   Core update.
 * PS You can disable the block editor through Edit Profile, Edit Forum Profile,
   and then check the box to disable the block editor at the bottom of the page.
 * Looking forward to your feedback
 *  Thread Starter [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16371501)
 * hi,
 * Sorry for the delay. As I see newest releases have been pushed out, I guess it
   is useless I test the proposed ones.
 * With the latest OceanWP on my machine, I still see the issue.
 * Perhaps WP core has a similar issue, but how come that it appears only if OceanWP
   is active?
 * Thanks in advance. And thanks for the editor block tip, didn’t know it 🙂
 *  Thread Starter [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16371634)
 * Further tests, without cache and many other things.
    No, OceanWP doesn’t seem
   to be the culprit as I said, sorry. Seems like it is the core, as you said!

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

The topic ‘PHP8.1 deprected functions’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/oceanwp/4.1.5/screenshot.png)
 * OceanWP
 * [Support Threads](https://wordpress.org/support/theme/oceanwp/)
 * [Active Topics](https://wordpress.org/support/theme/oceanwp/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/oceanwp/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/oceanwp/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [JCV](https://wordpress.org/support/users/psykonevro/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/php8-1-deprected-functions/#post-16371634)
 * Status: not resolved