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 == 10) { $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.4.00.0100.01615.16
7.3.120.0130.01614.91
7.3.110.0120.00914.82
7.3.100.0200.00714.81
7.3.90.0170.01015.24
7.3.80.0090.01515.05
7.3.70.0030.02014.80
7.3.60.0100.01414.79
7.3.50.0040.02514.95
7.3.40.0120.00414.94
7.3.30.0150.00615.10
7.3.20.0220.00616.55
7.3.10.0130.01016.66
7.3.00.0060.01916.72
7.2.250.0210.00715.03
7.2.240.0100.02015.36
7.2.230.0100.01615.01
7.2.220.0200.00715.25
7.2.210.0110.01415.27
7.2.200.0030.01915.38
7.2.190.0130.00915.23
7.2.180.0130.00715.16
7.2.170.0170.00714.98
7.2.00.0100.00719.39
7.1.330.0180.01115.63
7.1.320.0100.01715.90
7.1.310.0070.02015.82
7.1.300.0150.01115.94
7.1.290.0070.01815.65
7.1.280.0060.01915.83
7.1.270.0070.01415.98
7.1.260.0100.01315.69
7.1.70.0070.00717.18
7.1.60.0270.00719.46
7.1.50.0170.01316.96
7.1.00.0030.08322.40
7.0.200.0130.00316.84
7.0.140.0070.07722.15
7.0.60.0000.05019.97
7.0.50.0130.08318.04
7.0.40.0100.08320.27
7.0.30.0200.04320.17
7.0.20.0300.06720.04
7.0.10.0430.05320.16
7.0.00.0100.05720.01
5.6.280.0130.10021.05
5.6.210.0030.07020.68
5.6.200.0070.08318.22
5.6.190.0100.09020.48
5.6.180.0400.07020.57
5.6.170.0470.07320.50
5.6.160.0100.07020.70
5.6.150.0030.09018.08
5.6.140.0070.09018.12
5.6.130.0170.05018.07
5.6.120.0070.09021.06
5.6.110.0200.07720.92
5.6.100.0030.04721.14
5.6.90.0130.07321.13
5.6.80.0100.06020.54
5.6.70.0000.05720.53
5.5.350.0070.07020.32
5.5.340.0170.07718.00
5.5.330.0230.07720.40
5.5.320.0370.08020.14
5.5.310.0330.08720.28
5.5.300.0130.05017.98
5.5.290.0070.04317.92
5.5.280.0030.04720.75
5.5.270.0070.08720.80
5.5.260.0170.07720.79
5.5.250.0070.09320.71
5.5.240.0130.03020.10
5.4.450.0430.06019.41
5.4.440.3670.04719.45
5.4.430.0230.07319.40
5.4.420.0200.05319.45
5.4.410.0170.06019.40
5.4.400.0230.03719.25
5.4.390.0100.04319.16
5.4.380.0430.07019.06
5.4.370.0170.05019.13
5.4.360.0500.05719.09
5.4.350.0270.04318.89
5.4.340.0070.05019.25
5.4.320.0170.04212.64
5.4.310.0180.04412.64
5.4.300.0180.04412.65
5.4.290.0150.04612.64
5.4.280.0220.03612.54
5.4.270.0170.04112.54
5.4.260.0170.04112.54
5.4.250.0220.04112.54
5.4.240.0160.04312.54
5.4.230.0170.04512.53
5.4.220.0330.05319.13
5.4.210.0300.07019.08
5.4.200.0270.05018.77
5.4.190.0300.03318.90
5.4.180.0270.08319.04
5.4.170.3830.04018.77
5.4.160.0270.06719.11
5.4.150.3200.03719.04
5.4.140.3970.04016.34
5.4.130.0270.07316.28
5.4.120.0300.02716.18
5.4.110.0230.04716.47
5.4.100.0200.07716.52
5.4.90.0230.03316.48
5.4.80.0100.07016.53
5.4.70.0070.03716.34
5.4.60.0070.03716.46
5.4.50.0130.05716.41
5.4.40.0100.06716.52
5.4.30.0230.07716.43
5.4.20.0330.04716.52
5.4.10.1170.03716.41
5.4.00.3830.04715.79

preferences:
41.8 ms | 401 KiB | 5 Q