When trying to define an array such this:
$array = new SPLFixedArray(256);
for ($i = 0; $i < 256; $i++) {
$array[$i] = new SPLFixedArray(256);
for ($j = 0; $j < 256; $j++) {
$array[$i][$j] = new SPLFixedArray(5);
for ($k = 0; $k < 5; $k++) {
$array[$i][$j][$k] = 0;
}
}
}
I'm getting, only in CLI, "Segmentation Fault". I read about such errors here on SO in C/C++, where is likely to be a memory problem and recommends to load everything to the heap memory with malloc(). In PHP do we have such tool?
This happens even in small 3d arrays, such as 15 instead of 256 (but works under 15).
Thanks!