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, 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.0990.04015.33
7.2.90.0390.03915.36
7.2.80.1570.02615.33
7.2.70.1180.03515.61
7.2.60.2010.02615.76
7.2.50.0990.02815.62
7.1.220.0970.04714.59
7.1.210.1030.04014.59
7.1.200.1110.05114.83
7.1.190.1130.04814.63
7.1.180.1360.05914.80
7.0.310.1270.02813.97
5.6.380.0481.59115.53
5.6.370.0221.39315.77

preferences:
24.87 ms | 401 KiB | 5 Q