Here is my code, which creates 2d array filled with zeros, array dimensions are (795,6942):
function zeros($rowCount, $colCount){ $matrix = array();
You should try increasing the amount of memory available to PHP:
ini_set('memory_limit', '32M');
in your PHP file.