mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-22 04:55:10 +00:00
For each body should be wrapped in an if statement (#14)
unit test to go with commit
This commit is contained in:
parent
38deaaeb2e
commit
bbbf5cfc9d
@ -16,7 +16,9 @@ class Product
|
||||
{
|
||||
$product = 0;
|
||||
foreach ($a as $index => $value) {
|
||||
$product += $value * $b[$index];
|
||||
if (is_numeric($value) && is_numeric($b[$index])) {
|
||||
$product += $value * $b[$index];
|
||||
}
|
||||
}
|
||||
|
||||
return $product;
|
||||
|
Loading…
Reference in New Issue
Block a user