This repository has been archived on 2020-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
ext-collections/tests/007-average.phpt

12 lines
268 B
PHP

--TEST--
Test Collection::average().
--FILE--
<?php
$array = [2.632, 7.871, 9.094, 5.457, 3, 9, 6];
$average = Collection::init($array)->average();
if ($average != array_sum($array) / count($array)) {
echo 'Collection::average() failed.', PHP_EOL;
}
?>
--EXPECT--