--TEST-- Test for operator overloading of arithmetic operations. --SKIPIF-- --FILE-- forEach(function (Arma\MapVal $elem) { if ($elem->val() == 0) { $elem->setTo(7); } }); batch_assert_mat('operator overloading of arithmetic operations', [$mat->add($mat1), $mat + $mat1], [$mat->add(1), $mat + 1], [$mat->sub($mat1), $mat - $mat1], [$mat->sub(2), $mat - 2], [$mat->neg(), -$mat], [$mat->mul($mat1), $mat * $mat1], [$mat->mul(2), $mat * 2], [$mat->dotMul($mat1), $mat % $mat1], [$mat->div($mat1), $mat / $mat1], [$mat->div(2), $mat / 2] ); $mat2 = $mat->div($mat1); $mat3 = $mat1->add($mat2); $mat4 = $mat2->mul($mat3); $mat5 = $mat3->sub($mat4); $mat1 -= $mat *= $mat1 += $mat /= $mat1; batch_assert_mat('operator overloading of arithmetic operations', [$mat5, $mat1]); ?> --EXPECT--