3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* for each month i 6monthAvg = round( ( ( $profits[$i] +((isset($profits[$i-1])) ? $profits[$i-1] : 0) +((isset($profits[$i-2])) ? $profits[$i-2] : 0) +((isset($profits[$i-3])) ? $profits[$i-3] : 0) +((isset($profits[$i-4])) ? $profits[$i-4] : 0) +((isset($profits[$i-5])) ? $profits[$i-5] : 0))/6),2); for($i = 5, $length = count($months); $i < $length; $i++) { echo round(array_sum(array_slice($months, $i, -6), 2); } foreach(array_chunk($months, 6) as $sixMonths){ if(count($sixMonths) == 6) echo round(array_sum($sixMonths), 2); else echo "Not 6 months avilable"; } */ print_r(array_slice([1,2,3,4,5,6], 5, -6));

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)
8.3.40.0070.00718.68
8.3.30.0070.01118.60
8.3.20.0040.00420.13
8.3.10.0040.00423.66
8.3.00.0090.00023.52
8.2.170.0150.00022.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00320.94
8.2.120.0040.00426.35
8.2.110.0000.00920.94
8.2.100.0040.00718.09
8.2.90.0050.00318.87
8.2.80.0000.00817.97
8.2.70.0040.00817.38
8.2.60.0040.00417.91
8.2.50.0080.00018.07
8.2.40.0030.00622.34
8.2.30.0050.00320.56
8.2.20.0000.00717.51
8.2.10.0000.00717.81
8.2.00.0030.00617.92
8.1.270.0040.00423.88
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0150.00622.48
8.1.230.0000.01120.45
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0040.00417.11
8.1.190.0000.00816.98
8.1.180.0000.00718.10
8.1.170.0040.00418.50
8.1.160.0040.00420.55
8.1.150.0070.00018.81
8.1.140.0030.00719.45
8.1.130.0020.00517.65
8.1.120.0000.00717.38
8.1.110.0040.00417.39
8.1.100.0000.00817.23
8.1.90.0030.00517.35
8.1.80.0040.00417.37
8.1.70.0030.00617.17
8.1.60.0000.00717.45
8.1.50.0050.00317.34
8.1.40.0000.00817.36
8.1.30.0090.00017.47
8.1.20.0000.00717.43
8.1.10.0000.00817.41
8.1.00.0050.00217.21
8.0.300.0000.00818.77
8.0.290.0000.00816.58
8.0.280.0030.00318.23
8.0.270.0030.00317.13
8.0.260.0000.00617.13
8.0.250.0030.00316.88
8.0.240.0060.00016.77
8.0.230.0070.00016.84
8.0.220.0040.00416.66
8.0.210.0090.00016.80
8.0.200.0000.00616.79
8.0.190.0030.00516.83
8.0.180.0070.00016.85
8.0.170.0000.00816.75
8.0.160.0040.00416.72
8.0.150.0000.00816.70
8.0.140.0000.00816.76
8.0.130.0000.00513.16
8.0.120.0000.00716.65
8.0.110.0000.00816.75
8.0.100.0030.00616.75
8.0.90.0030.00316.71
8.0.80.0090.00616.70
8.0.70.0040.00416.80
8.0.60.0050.00316.74
8.0.50.0030.00516.60
8.0.30.0060.01217.02
8.0.20.0110.00817.40
8.0.10.0000.00716.76
8.0.00.0150.00716.67
7.4.330.0000.00516.89
7.4.320.0030.00316.38
7.4.300.0040.00416.48
7.4.290.0000.00716.33
7.4.280.0030.00616.47
7.4.270.0030.00316.36
7.4.260.0070.00016.35
7.4.250.0050.00216.44
7.4.240.0000.00716.39
7.4.230.0030.00316.29
7.4.220.0120.01116.59
7.4.210.0030.01016.50
7.4.200.0040.00416.30
7.4.160.0030.01616.16
7.4.150.0100.00717.40
7.4.140.0100.00817.86
7.4.130.0060.01016.34
7.4.120.0130.00616.44
7.4.110.0100.00716.32
7.4.100.0140.00916.35
7.4.90.0100.00716.24
7.4.80.0100.00619.39
7.4.70.0100.00716.54
7.4.60.0150.00316.46
7.4.50.0040.01216.36
7.4.40.0070.01016.28
7.4.30.0150.00916.55
7.4.00.0040.01114.66
7.3.330.0000.00613.09
7.3.320.0040.00413.07
7.3.310.0070.00015.96
7.3.300.0040.00416.03
7.3.290.0100.00716.11
7.3.280.0110.00716.13
7.3.270.0140.00317.40
7.3.260.0080.00816.47
7.3.250.0070.01116.17
7.3.240.0110.00816.19
7.3.230.0070.01016.39
7.3.210.0100.00716.13
7.3.200.0090.00916.37
7.3.190.0100.00716.11
7.3.180.0120.00316.20
7.3.170.0060.01016.27
7.3.160.0030.01216.20
7.2.330.0080.00816.21
7.2.320.0130.00316.39
7.2.310.0120.00916.58
7.2.300.0070.01416.08
7.2.290.0110.00516.19
7.2.00.0030.01218.97
7.1.100.0000.01218.07
7.1.70.0050.00317.07
7.1.60.0100.01319.52
7.1.50.0100.01316.80
7.1.00.0030.07722.30
7.0.200.0110.00314.74
7.0.60.0100.03319.91
7.0.50.0070.03717.87
7.0.40.0070.04020.09
7.0.30.0200.04320.30
7.0.20.0270.03720.20
7.0.10.0070.07320.12
7.0.00.0100.06720.20
5.6.280.0000.06320.98
5.6.210.0130.07720.44
5.6.200.0070.05318.22
5.6.190.0130.08020.60
5.6.180.0300.06020.41
5.6.170.0170.07020.52
5.6.160.0130.07720.40
5.6.150.0070.04318.17
5.6.140.0100.03318.21
5.6.130.0100.08318.11
5.6.120.0100.08021.01
5.6.110.0130.08721.08
5.6.100.0030.08020.97
5.6.90.0000.04720.96
5.6.80.0130.07320.50
5.5.350.3830.04020.31
5.5.340.0030.07017.92
5.5.330.0130.07720.07
5.5.320.0170.06320.17
5.5.310.0130.04720.27
5.5.300.0030.04017.91
5.5.290.0070.07317.98
5.5.280.0130.06320.84
5.5.270.0100.08020.75
5.5.260.0070.05020.87
5.5.250.0070.06720.65
5.5.240.0000.04020.23

preferences:
43.54 ms | 400 KiB | 5 Q