Title: Error with PHP 8.4
Last modified: October 23, 2025

---

# Error with PHP 8.4

 *  Resolved [acsafrica](https://wordpress.org/support/users/acsafrica/)
 * (@acsafrica)
 * [8 months ago](https://wordpress.org/support/topic/error-with-php-8-4-3/)
 *     ```wp-block-code
       [23-Oct-2025 15:50:59 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:50:59 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:00 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:00 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:00 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:01 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:01 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:01 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:02 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:02 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:03 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:03 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162[23-Oct-2025 15:51:03 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/abanista/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 162
       ```
   
 * i am encountering multiple logs of above type

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

 *  [SH Sajal Chowdhury](https://wordpress.org/support/users/shsajalchowdhury/)
 * (@shsajalchowdhury)
 * [8 months ago](https://wordpress.org/support/topic/error-with-php-8-4-3/#post-18693182)
 * Hello [@acsafrica](https://wordpress.org/support/users/acsafrica/) ,
   This is 
   a PHP 8.4 compatibility issue with WooCommerce. it’s just a deprecation warning,
   not breaking anything. You can downgrade PHP version. 8.2 or 8.3 (note: make 
   sure your other’s theme/plugins won’t have any issue with these version. Probably
   WooCommerce isn’t fully compatible with PHP 8.4 but they are actively working
   on it.The warning you are getting is about WooCommerce’s math library is passing
   null values which PHP 8.4 now flags as deprecated.
 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [8 months ago](https://wordpress.org/support/topic/error-with-php-8-4-3/#post-18693382)
 * Hi [@acsafrica](https://wordpress.org/support/users/acsafrica/),
 * Thank you for bringing up the issue you’re experiencing with WooCommerce on PHP
   8.4. I understand how concerning it can be to see repeated deprecation warnings,
   and it’s completely reasonable to want clarity on what’s happening and how to
   resolve it.
 * I appreciate the helpful insights shared by [@shsajalchowdhury](https://wordpress.org/support/users/shsajalchowdhury/),
   who explained that this is a compatibility issue with WooCommerce when running
   on PHP 8.4. Thankfully, this warning is about deprecated behavior—it won’t break
   your site, but it does point out where WooCommerce’s math library is passing `
   null` values to the `preg_match()` function, which PHP 8.4 now flags as deprecated.
 * For now, a practical solution would be to downgrade your PHP version to 8.2 or
   8.3 if possible (just be sure to check that your other plugins and themes will
   work well on those versions first). WooCommerce developers are actively working
   to update compatibility with newer PHP releases.
 * If you have further questions or encounter any other issues as you adjust your
   PHP setup, please let us know. We’re here to help!
 *  Plugin Support [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * (@thelmachido)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/error-with-php-8-4-3/#post-18704259)
 * It’s been a while since we heard back from you for this reason we are closing
   this thread. 
 * If WooCommerce has been useful for your store and you appreciate the support 
   you’ve received, we’d truly appreciate it if you could leave us a quick review
   here: 
 *  [https://wordpress.org/support/plugin/woocommerce/reviews/#new-post](https://wordpress.org/support/plugin/woocommerce/reviews/#new-post)
 * Feel free to open a new forum topic if you run into any other problem. 

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

The topic ‘Error with PHP 8.4’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * Last activity: [7 months, 2 weeks ago](https://wordpress.org/support/topic/error-with-php-8-4-3/#post-18704259)
 * Status: resolved