3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all = []; for( $i=0; $i<2000; $i++ ) { for( $j=0; $j<500; $j++ ) { $all[$i][$j] = $j; } } $mergedArray = []; $start = microtime(true); foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } $mergedArray = []; foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } $mergedArray = []; foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } echo PHP_EOL . 'Union time: ' . microtime(true); $start = microtime(true); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); echo PHP_EOL . 'Array merge time: ' . microtime(true);
Output for git.master_jit
Union time: 1761814808.1276 Array merge time: 1761814808.165
Output for git.master
Union time: 1761814808.0332 Array merge time: 1761814808.058

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:
28.02 ms | 406 KiB | 5 Q