Skip to content

Instantly share code, notes, and snippets.

<?php
function bench_array(int $n, int $iterations) {
$totalReadTime = 0.0;
$startTime = hrtime(true);
$total = 0;
for ($j = 0; $j < $iterations; $j++) {
$startMemory = memory_get_usage();
$values = [];
for ($i = 0; $i < $n; $i++) {