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) { //echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES ("; var_dump($piv); } //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.0850.02315.55
7.2.90.1680.03015.53
7.2.80.1190.02415.61
7.2.70.1480.03415.52
7.2.60.0250.02915.56
7.2.50.0790.03415.74
7.1.220.0860.04114.87
7.1.210.1290.03414.86
7.1.200.0250.03614.80
7.1.190.0460.03514.45
7.1.180.1230.04014.68
7.0.310.1230.04214.44
5.6.380.0662.20715.48
5.6.370.0481.85315.82

preferences:
29.66 ms | 400 KiB | 5 Q