While working on PureTextRender package, I realized some serious limits in PHP arrays. The mentioned package renders text into BMP images using pure PHP (no GD), and for that it requires a lot of arrays to be filled and traversed. The original package only supported small images due to typical PHP memory limit (128MB) though images were monochrome BMP! Before going any further, let’s see some PHP benchmark code: <?php //array_fill() Memory Usage $startMemory=(memory_get_usage()/1024); $a=array_fill(0, 1000, 0); echo PHP_EOL.((memory_get_usage()/1024)-$startMemory)." KB".PHP_EOL; …