Ds\Sequence::sum

Returns the sum of all values in the sequence

&reftitle.description; abstract public ``int``float```Ds\Sequence::sum`

Returns the sum of all values in the sequence.

Arrays and objects are considered equal to zero when calculating the sum.

&reftitle.parameters; &no.function.parameters;
&reftitle.returnvalues;

The sum of all the values in the sequence as either a `float` or `int` depending on the values in the sequence.

&reftitle.examples;

### `Ds\Sequence::sum` integer example

    <?php
    $sequence = new \Ds\Vector([1, 2, 3]);
    var_dump($sequence->sum());
    ?>

&example.outputs.similar;

    int(6)

### `Ds\Sequence::sum` float example

    <?php
    $sequence = new \Ds\Vector([1, 2.5, 3]);
    var_dump($sequence->sum());
    ?>

&example.outputs.similar;

    float(6.5)