The toArray()
method /always/ takes the values from cell 'A1' to the highest column/row in the worksheet.... irrespective of whether cells are populated or not; and yes, that will affect memory footprint; that's why we also provide a rangeToArray()
method where you can specify the actual range, e.g.
$myArray = $objPHPExcel->getActiveSheet()->rangeToArray('A3:C4');
When you apply a read filter to only read cells A3 to C4, PHPExcel still populates cell A3 with the value of cell A3 from the original file, it simply doesn't populate data in cells outside of the read filter.... this means that those cells outside the specified range aren't loaded, so saving on memory. But if you try to access a cell outside that range from within your script (and toArray() does reference cells A1, B1, C1, A2, B2, C2 in your case) then empty cells will be created in memory, leading to this memory spike.