3v4l.org

run code in 300+ PHP versions simultaneously
<?php $letters = array('a','b','c','d','e','f','g','h'); $array = array(); // mt_rand used just for filling array, it may be filled manually if neccessary for ($i=0; $i< 200; ++$i) { $array[] = $letters[mt_rand(0,count($letters)-1)]; } for ($i=0; $i< 10000; ++$i) { echo randTest($array)."<br />"; } function randTest($array) { $out = array(); while (count($array) > 0) { $index = array_rand($array,1); $out[] = $array[$index]; unset($array[$index]); } return implode('', $out); }

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).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.100.0790.01714.93
7.2.90.0710.01514.84
7.2.80.0810.01614.42
7.2.70.0760.00815.18
7.2.60.0710.02114.84
7.2.50.0120.01214.93
7.2.40.0640.01414.84
7.1.220.0770.00713.68
7.1.210.0580.01013.77
7.1.200.0730.01113.34
7.1.190.0670.01413.95
7.1.180.0800.01613.90
7.1.170.0050.01814.03
7.0.310.0870.03413.54
7.0.300.0780.03113.59
5.6.380.0130.03614.37
5.6.370.0110.04314.45
5.6.360.0110.04414.27

preferences:
46.53 ms | 401 KiB | 5 Q