.. _array_sum():-addition-is-not-supported-on-type-array: array_sum(): Addition is not supported on type array ---------------------------------------------------- .. meta:: :description: array_sum(): Addition is not supported on type array: array_sum() adds each element in the first argument, with each other. :og:image: https://php-errors.readthedocs.io/en/latest/_static/logo.png :og:type: article :og:title: array_sum(): Addition is not supported on type array :og:description: array_sum() adds each element in the first argument, with each other :og:url: https://php-errors.readthedocs.io/en/latest/messages/array_sum%28%29%3A-addition-is-not-supported-on-type-array.html :og:locale: en :twitter:card: summary_large_image :twitter:site: @exakat :twitter:title: array_sum(): Addition is not supported on type array :twitter:description: array_sum(): Addition is not supported on type array: array_sum() adds each element in the first argument, with each other :twitter:creator: @exakat :twitter:image:src: https://php-errors.readthedocs.io/en/latest/_static/logo.png .. raw:: html Description ___________ array_sum() adds each element in the first argument, with each other. This is a valid operation for integers, floats, numeric strings, booleans and null, as they can be cast to numbers. This is not the case for arrays, objects, non-numeric strings or resources, which yield this warning, and are omitted in the operation. Until PHP 8.3, the omission of invalid argument was a silent behavior. Example _______ .. code-block:: php Solutions _________ + Filter out all values in the first argument not actually numeric: aka, they can't be cast to integer or float without error. + Filter out all arrays inside the first argument. Related Error Messages ______________________ + :ref:`array_product():-multiplication-is-not-supported-on-type-object`