Although the order of matrices should be fine, the following code throws back the exception. It might be a tiny thing I\'m not being able to notice, but can\'t figure it out.
You're specifying your test matrices wrong, in two ways:
array( )
around them, the condition that the width of the first matrix be equal to the height of the second matrix doesn't hold with [5 1] and [1 5], which are both 2 wide and 1 high.What you need is something like
$mat1 = array(array(5,1));
$mat2 = array(array(1),array(5));