Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
7.1.6 | 0.017 | 0.013 | 35.10 |
<?php
if (substr(PHP_VERSION, 0, 5) !== '7.1.6') die('Meh');
function test($label = '') {
global $t;
$t2 = microtime(1);
if ($label) echo str_pad($label . ': ', 32, '.', STR_PAD_RIGHT) . ' ' . 1000 * ($t2 - $t) . 'ms' . "\n";
$t = $t2;
}
$c = 30;
$c2 = 30;
test();
for ($i = $c; $i--;) {
for ($j = $c2; $j--;) {
$a = [0, 1, 2, 3, 4];
unset($a[0]);
}
}
test('unset list => map');
for ($i = $c; $i--;) {
for ($j = $c2; $j--;) {
$a = ['c' => 0, 1, 2, 3, 4];
unset($a['c']);
}
}
test('unset map => list');
for ($i = $c; $i--;) {
for ($j = $c2; $j--;) {
$a = ['c' => 0, 'd' => 1, 2, 3, 4];
unset($a['c']);
}
}
test('unset map => map');
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
7.1.6 | 0.017 | 0.013 | 35.10 |