Title: PHP Warning: array_sum(): Addition is not supported
Last modified: December 26, 2023

---

# PHP Warning: array_sum(): Addition is not supported

 *  Resolved [tamar](https://wordpress.org/support/users/tamar/)
 * (@tamar)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/)
 * I am trying to use a REST-API integration with WooCommerce 8.4.0 (specifically,
   PirateShip, which I’ve used successfully in the past). It connects but it can’t
   fetch the WooCommerce data, and I noticed the following in the logs.
 * `[26-Dec-2023 22:54:22 UTC] PHP Warning: array_sum(): Addition is not supported
   on type string in /home/public_html/wp-content/plugins/woocommerce/includes/rest-
   api/Controllers/Version1/class-wc-rest-orders-v1-controller.php on line 271`
 * I’m wondering if this is why PirateShip isn’t working, and how exactly do I get
   around this? Would rolling back a couple versions at least get the connetiction
   working? I’m compelled to give that a shot… but would rather fix the current 
   version.

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

 *  Thread Starter [tamar](https://wordpress.org/support/users/tamar/)
 * (@tamar)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17302666)
 * This is the associated code on line 271 (in bold)
 *     ```wp-block-code
                               if ( ! empty( $shipping_taxes['total'] ) ) {
                                       $shipping_line['total_tax'] = wc_format_decimal( array_sum( $shipping_taxes['total'] ), $dp );
   
                                       foreach ( $shipping_taxes['total'] as $tax_rate_id => $tax ) {
                                               $shipping_line['taxes'][] = array(
                                                       'id'       => $tax_rate_id,
                                                       'total'    => $tax,
                                               );
                                       }
       ```
   
 * Kind of lost here. I’m looking at my taxes and they’re the same as they’ve always
   been. This code seems to have existed from WooCommerce 7.x and up.
 * And yes, I rolled back to WP 2.x, kept incrementally increasing to 3, 4, 5, 6,
   all of which threw fatal errors till 7.x.
 *  Thread Starter [tamar](https://wordpress.org/support/users/tamar/)
 * (@tamar)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17302667)
 * Evidently this is a known bug specifically related to PHP 8.3. I downgraded to
   8.2 and it works.
 * [https://github.com/woocommerce/woocommerce/pull/41205](https://github.com/woocommerce/woocommerce/pull/41205)
 * Gonna hope they fix it soon.
 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17302716)
 * Hey [@tamar](https://wordpress.org/support/users/tamar/),
 * As you know, our team is already aware of this issue.
 * At the time being, we can’t give you an estimate for when the team will look 
   into or fix the issue, as bug reports are prioritized based on a few criteria.
 * I’ll be marking the thread as solved for now, but feel free to [open a new one](https://wordpress.org/support/plugin/woocommerce/#new-topic-0)
   if you have any other questions.
 * Thanks!
 *  Thread Starter [tamar](https://wordpress.org/support/users/tamar/)
 * (@tamar)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17302718)
 * Yup, got my answer, thanks!
 *  [jankadlecik](https://wordpress.org/support/users/jankadlecik/)
 * (@jankadlecik)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17367435)
 * PHP 8.2 Fixes issue

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

The topic ‘PHP Warning: array_sum(): Addition is not supported’ 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/)

 * 5 replies
 * 3 participants
 * Last reply from: [jankadlecik](https://wordpress.org/support/users/jankadlecik/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/php-warning-array_sum-addition-is-not-supported/#post-17367435)
 * Status: resolved