i try to make array with PHP. The dimension of the array is 26000 x 26000. Is it possible to make array that big? I already try to make an array with dimension 10000 x 10000 but the program keep telling me this:
Fatal error: Out of memory (allocated 1886388224) (tried to allocate 24 bytes) in C:\xampp\htdocs\matrix\index.php on line 24
i have 8GB RAM, i already set the memory_limit in php.ini with -1 (apache configuration). the code for build the array is this:
function zeros($rowCount, $colCount)
{
$matrix = array();
for ($rowIndx=0; $rowIndx<$rowCount; $rowIndx++)
{
$matrix[] = array();
for($colIndx=0; $colIndx<$colCount; $colIndx++)
{
$matrix[$rowIndx][$colIndx]=0;
}
var_dump(memory_get_usage());
}
return $matrix;
}
$matrix = zeros(25000,25000);
I also already try using SplFixedArray, but the result is the same. Please help me, thanks! :)