> For the complete documentation index, see [llms.txt](https://arrayutils.docs.present.kim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arrayutils.docs.present.kim/methods/g/sum.md).

# sum()

{% code title="Example.php" %}

```php
<?php use kim\present\utils\arrays\ArrayUtils;

$arrayUtils = ArrayUtils::from(range(1, 10));

$arrayUtils->sum();// expected output: 55
```

{% endcode %}

## Syntax

```php
$arrayUtils->sum() : int|float;
```

### Return value

* &#x20;The sum of values as an integer or float

## Prefixing

```php
ArrayUtils::sumFrom(iterable $from) : int|float;
```

## References

{% embed url="<https://www.php.net/manual/en/function.array-sum.php>" %}
