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 $key => $piv) { echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES "; foreach($piv as $pi) { echo "(", $key, ", ", $pi, ")"; if($pi !== end($piv)) { echo ","; } } echo ";"; } //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.1310.03115.82
7.2.90.1300.02315.81
7.2.80.1440.04415.68
7.2.70.1490.04215.91
7.2.60.1140.03815.84
7.2.50.0660.01915.87
7.1.220.0470.04714.73
7.1.210.1190.05214.67
7.1.200.1380.05314.87
7.1.190.0540.06114.84
7.1.180.1650.03314.60
7.0.310.1740.05414.22
5.6.380.0461.33815.88
5.6.370.0202.32815.44

preferences:
32.53 ms | 401 KiB | 5 Q