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.1590.03315.37
7.2.90.1650.02315.46
7.2.80.2550.04615.61
7.2.70.1960.03515.82
7.2.60.1850.05215.86
7.2.50.0470.04015.81
7.1.220.2470.04614.82
7.1.210.1750.03214.56
7.1.200.1490.04414.70
7.1.190.1010.04914.41
7.1.180.0690.03114.78
7.0.310.1320.04914.49
5.6.380.0202.41015.69
5.6.370.0132.43415.85

preferences:
31.73 ms | 400 KiB | 5 Q