sum() публичный Метод

Get the sum of all elements inside the array.
public sum ( ) : number
Результат number The sum of all elements from within the current array.
Пример #1
0
 public function testSum()
 {
     $a = new ArrayObject([1, 2, 3]);
     $sum = $a->sum();
     $this->assertSame(6, $sum);
 }