3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit',-1); $i=10000; $a=[]; $time_a=microtime(true); for($z=0;$z<$i;$z++){ $a=array_merge($a,[0,1,2,3,4,5,6,7,8,9]); } $time_a=microtime(true)-$time_a; $b=[]; $time_b=microtime(true); for($z=0;$z<$i;$z++){ $b=[...$b,...[0,1,2,3,4,5,6,7,8,9]]; } $time_b=microtime(true)-$time_b; $c=[]; $time_c=microtime(true); for($z=0;$z<$i;$z++){ array_push($c,...[0,1,2,3,4,5,6,7,8,9]); // $b[]=...[0,1,2,3,4,5,6,7,8,9]; } $time_c=microtime(true)-$time_c; print($time_a.' sec'); print('<br/>'); print($time_b.' sec'); print('<br/>'); print($time_c.' sec');
Output for git.master, git.master_jit

Process exited with code 137.

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:
27.79 ms | 401 KiB | 7 Q