3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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');
Output for 7.1.6
unset list => map: ............. 0.08702278137207ms unset map => list: ............. 0.15807151794434ms unset map => map: .............. 0.099897384643555ms