Title: Missing operand type conversion on PHP 8.3
Last modified: January 6, 2025

---

# Missing operand type conversion on PHP 8.3

 *  Resolved [gekomees](https://wordpress.org/support/users/gekomees/)
 * (@gekomees)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/missing-operand-type-conversion-on-php-8-3/)
 * I had to fix two errors on a site with PHP 8.3 where a plugin that added a shipping
   method was causing Flexible shipping to go into a fatal error. Although the error
   is caused by the two plugins in conjunction, it can be fixed easily by casting
   the values into the float type. I hope the developers can implement this to fix
   any other shipping method plugins returning values in the wrong type.
 * PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + float
   in /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/Rule/CostsCalculator.
   php:180
 * PHP Fatal error: Uncaught TypeError: Unsupported operand types: float – string
   in /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethodsIntegration/
   ShippingRate.php:86
 * Full stack trace (first error):
 * Stack trace: 0 /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/
   Rule/CostsCalculator.php(212): WPDesk\FS\TableRate\Rule\CostsCalculator->sum_calculation(”,
   0.0) 1 /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/Rule/CostsCalculator.
   php(135): WPDesk\FS\TableRate\Rule\CostsCalculator->calculate_cost(”) 2 /wp-content/
   plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethodsIntegration/
   ShippingRate.php(85): WPDesk\FS\TableRate\Rule\CostsCalculator->process_rules(”)
   3 /wp-includes/class-wp-hook.php(324): WPDesk\FS\TableRate\ShippingMethodsIntegration\
   ShippingRate->add_table_rate_shipping_rate(Array, Object(MakeCommerce\Shipping\
   Method\ParcelMachine\DPD)) 4 /wp-includes/plugin.php(205): WP_Hook->apply_filters(
   Array, Array) 5 /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-
   shipping-method.php(290): apply_filters(‘woocommerce_shi…’, Array, Object(MakeCommerce\
   Shipping\Method\ParcelMachine\DPD)) 6 /wp-content/plugins/makecommerce/shipping/
   method/method.php(428): WC_Shipping_Method->add_rate(Array) 7 /wp-content/plugins/
   woocommerce/includes/abstracts/abstract-wc-shipping-method.php(257): MakeCommerce\
   Shipping\Method->calculate_shipping(Array) 8 /wp-content/plugins/woocommerce/
   includes/class-wc-shipping.php(348): WC_Shipping_Method->get_rates_for_package(
   Array) 9 /wp-content/plugins/woocommerce/includes/class-wc-shipping.php(260):
   WC_Shipping->calculate_shipping_for_package(Array, 0) 10 /wp-content/plugins/
   woocommerce/includes/class-wc-cart.php(1431): WC_Shipping->calculate_shipping(
   Array) 11 /wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(346):
   WC_Cart->calculate_shipping() 12 /wp-content/plugins/woocommerce/includes/class-
   wc-cart-totals.php(857): WC_Cart_Totals->get_shipping_from_cart() 13 /wp-content/
   plugins/woocommerce/includes/class-wc-cart-totals.php(151): WC_Cart_Totals->calculate_shipping_totals()
   14 /wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(141): WC_Cart_Totals-
   >calculate() 15 /wp-content/plugins/woocommerce/includes/class-wc-cart.php(1409):
   WC_Cart_Totals->__construct(Object(WC_Cart)) 16 /wp-content/plugins/woocommerce/
   includes/shortcodes/class-wc-shortcode-cart.php(96): WC_Cart->calculate_totals()
   17 /wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(72): WC_Shortcode_Cart::
   output(Array) 18 /wp-content/plugins/woocommerce/includes/class-wc-shortcodes.
   php(85): WC_Shortcodes::shortcode_wrapper(Array) 19 /wp-includes/shortcodes.php(
   434): WC_Shortcodes::cart(Array, ”, ‘woocommerce_car…’) 20 [internal function]:
   do_shortcode_tag(Array) 21 /wp-includes/shortcodes.php(273): preg_replace_callback(‘/\[(\[?)(
   woocom…’, ‘do_shortcode_ta…’, ‘[woocommerce_ca…’) 22 /wp-includes/class-wp-hook.
   php(324): do_shortcode(‘[woocommerce_ca…’) 23 /wp-includes/plugin.php(205): WP_Hook-
   >apply_filters(‘[woocommerce_ca…’, Array) 24 /wp-includes/post-template.php(256):
   apply_filters(‘the_content’, ‘[woocommerce_ca…’) 25 /wp-content/themes/nordfix/
   loops/content.php(12): the_content() 26 /wp-includes/template.php(812): require(‘/
   data01/virt393…’) 27 /wp-includes/template.php(745): load_template(‘/data01/virt393…’,
   false, Array) 28 /wp-includes/general-template.php(206): locate_template(Array,
   true, false, Array) 29 /wp-content/themes/nordfix/index.php(27): get_template_part(‘
   loops/content’, ”) 30 /wp-includes/template-loader.php(106): include(‘/data01/
   virt393…’) 31 /wp-blog-header.php(19): require_once(‘/data01/virt393…’) 32 /index.
   php(17): require(‘/data01/virt393…’) 33 {main}
 * thrown in /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/Rule/
   CostsCalculator.php on line 180

Viewing 1 replies (of 1 total)

 *  Plugin Author [Grzegorz Rola](https://wordpress.org/support/users/grola/)
 * (@grola)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/missing-operand-type-conversion-on-php-8-3/#post-18231645)
 * Hi [@gekomees](https://wordpress.org/support/users/gekomees/), thank you for 
   your feedback. We will take your suggestions into account in the next version
   of the plugin.
 * Best regards
   Grzegorz

Viewing 1 replies (of 1 total)

The topic ‘Missing operand type conversion on PHP 8.3’ is closed to new replies.

 * ![](https://ps.w.org/flexible-shipping/assets/icon.svg?rev=2737045)
 * [Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping](https://wordpress.org/plugins/flexible-shipping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-shipping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-shipping/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-shipping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-shipping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-shipping/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Grzegorz Rola](https://wordpress.org/support/users/grola/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/missing-operand-type-conversion-on-php-8-3/#post-18231645)
 * Status: resolved