3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pivot = []; $n = 0; for ($i = 1; $i <= 100; $i++) { $pivot[$i] = []; } for($i = 1; $i <= 100; $n++) { $user = &$pivot[rand($i, 100)]; $rand = rand(0, 100); $random = $rand != $user ? $rand : $rand + 1; while(array_key_exists($random, $user)) { $random++; } $user[] = $random; if($n == 100) { $i++; $n = 0; } } foreach($pivot as $piv => $key) { //echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES ("; var_dump($piv); var_dump($key); //foreach($piv as $pi) { // echo $key, ", ", $pi, PHP_EOL; //} } //print_r($pivot);

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.0740.02915.47
7.2.90.2050.03315.63
7.2.80.1760.03415.61
7.2.70.0160.04215.91
7.2.60.0720.04615.81
7.2.50.0290.03915.79
7.1.220.0320.03314.70
7.1.210.0280.03514.73
7.1.200.1630.03414.69
7.1.190.0440.02614.72
7.1.180.0310.03114.58
7.0.310.0340.04214.45
5.6.380.0101.91716.09
5.6.370.0262.31515.80

preferences:
33.8 ms | 401 KiB | 5 Q