Title: php 8.4 bug
Last modified: July 18, 2026

---

# php 8.4 bug

 *  Resolved [mmdrzw122](https://wordpress.org/support/users/mmdrzw122/)
 * (@mmdrzw122)
 * [3 weeks ago](https://wordpress.org/support/topic/php-8-4-bug/)
 * Hello,
 * I would like to report a compatibility issue that appears to affect your plugin
   when running on PHP 8.4.
 * **Environment**
    - WordPress: 7.0.2
    - WooCommerce: Latest version
    - PHP: 8.4
    - Theme: Woodmart 8.5.5
 * **Problem**
 * A fatal error occurs while updating the WooCommerce cart via AJAX.
 * The error is:
 *     ```wp-block-code
       Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given
       ```
   
 * File:
 *     ```wp-block-code
       wp-content/plugins/woo-min-max-quantity-step-control-single/includes/min-max-controller.php
       ```
   
 * Line:
 *     ```wp-block-code
       987
       ```
   
 * Backtrace:
 *     ```wp-block-code
       #0 .../min-max-controller.php(987): method_exists(false, 'is_sold_individually')
       #1 .../class-wp-hook.php(341): WC_MMQ\Includes\Min_Max_Controller->update_cart_validation(...)
       #2 .../plugin.php(205): WP_Hook->apply_filters(...)
       #3 .../woodmart/inc/integrations/woocommerce/modules/quantity.php(62): apply_filters('woocommerce_update_cart_validation', ...)
       #4 .../class-wp-hook.php(341): woodmart_update_cart_item('')
       #5 .../plugin.php(522): WP_Hook->do_action(...)
       #6 .../wp-admin/admin-ajax.php(207): do_action(...)
       ```
   
 * **Cause**
 * It appears that `wc_get_product( $product_id )` can return `false` in some situations.
   However, the plugin immediately calls:
 *     ```wp-block-code
       method_exists( $this->product, 'is_sold_individually' )
       ```
   
 * When `$this->product` is `false`, PHP 8.4 throws a fatal `TypeError`.
 * This seems to be caused by a missing validation before calling `method_exists()`
   or other product methods.
 * **Suggested Fix**
 * Before calling any product methods, please verify that the returned value is 
   a valid `WC_Product` object. For example:
 *     ```wp-block-code
       $this->product = wc_get_product( $product_id );
   
       if ( ! $this->product instanceof WC_Product ) {
           return $bool;
       }
   
       if ( $this->product->is_sold_individually() ) {
           return $bool;
       }
       ```
   
 * or use another equivalent validation that ensures `$this->product` is a valid
   object before accessing its methods.
 * I believe this is a compatibility issue with newer PHP versions rather than WooCommerce
   itself.
 * Thank you for your work on the plugin. I hope this issue can be addressed in 
   a future update.

Viewing 1 replies (of 1 total)

 *  Plugin Support [NAZMUL](https://wordpress.org/support/users/bmnazmul/)
 * (@bmnazmul)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-8-4-bug/#post-18970697)
 * Hello [@mmdrzw122](https://wordpress.org/support/users/mmdrzw122/),
 * Thank you so much for bringing this to our attention and for providing such a
   detailed report and helpful fix!
 * We have resolved this issue in the latest update of the plugin by adding proper
   validation checks to ensure the product is a valid `WC_Product` object before
   calling its methods.
 * Please update the plugin to the latest version. If you run into any other issues
   or have further feedback, feel free to reach out.
 * Thanks again for helping us make the plugin better!

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-8-4-bug%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/woo-min-max-quantity-step-control-single/assets/icon-256x256.
   png?rev=3538540)
 * [Min Max Control - Min Max Quantity & Step Control for WooCommerce](https://wordpress.org/plugins/woo-min-max-quantity-step-control-single/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-min-max-quantity-step-control-single/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-min-max-quantity-step-control-single/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-min-max-quantity-step-control-single/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-min-max-quantity-step-control-single/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-min-max-quantity-step-control-single/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [NAZMUL](https://wordpress.org/support/users/bmnazmul/)
 * Last activity: [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-8-4-bug/#post-18970697)
 * Status: resolved