3v4l.org

run code in 300+ PHP versions simultaneously
<?php $benchFx = function (string $msg, \Closure $fx) { $times = []; for ($i = 0; $i < 100; $i++) { $t = microtime(true); $fx(); $t = microtime(true) - $t; $times[] = $t; } $bestTime = min($times); echo $msg . ': ' . round($bestTime * 1000, 2) . " ms\n"; }; $benchFx('array_shift', function () { $arr = range(1, 2_000); while (array_shift($arr)); }); $benchFx('array_pop', function () { $arr = range(1, 2_000); while (array_pop($arr)); });
Output for git.master
array_shift: 2.23 ms array_pop: 0.03 ms
Output for git.master_jit
array_shift: 2.31 ms array_pop: 0.03 ms

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.22 ms | 411 KiB | 5 Q