toArray(); for ($x = 0; $x < $dimensions; ++$x) { $grid[$x][$x] = 1; } return new Matrix($grid); } }