sheet('Orders') ->withHeaderRow(1) ->withOptions(['skip_empty_rows' => true]); if ($mode === 'array') { $rowsRead = count($session->toArray()); } else { $rowsRead = 0; foreach ($session->rows() as $_row) { $rowsRead++; } } $times[] = (hrtime(true) - $started) / 1_000_000; } sort($times); $median = $times[(int) floor(count($times) / 2)]; echo json_encode([ 'library' => 'mnb/mnb-phpexcel', 'php' => PHP_VERSION, 'mode' => $mode, 'file' => realpath($path) ?: $path, 'file_bytes' => filesize($path), 'iterations' => $iterations, 'rows' => $rowsRead, 'median_ms' => round($median, 3), 'peak_memory_bytes' => memory_get_peak_usage(true), ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR), PHP_EOL;