3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rangeOfMonths($prior, $ahead, $currentYear = null, $currentMonth = null) { $currentYear = $currentYear ?: date('Y'); $currentMonth = $currentMonth ?: date('m'); $rangeStart = new DateTime($currentYear . '-' . $currentMonth . '-01 23:59:59'); $rangeEnd = clone($rangeStart); $rangeStart->modify("-{$prior} month"); $rangeEnd->modify("+{$ahead} month +1 day"); $period = new DatePeriod($rangeStart, new DateInterval('P1M'), $rangeEnd); $monthsList = []; foreach ($period as $i => $dateObject) { $monthsList[] = [ 'year' => $dateObject->format('Y'), 'nr_month' => $dateObject->format('n'), 'month_name' => $dateObject->format('M'), 'current' => $i == $prior ]; } return $monthsList; } var_export(rangeOfMonths(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.4.140.0150.00617.67
8.4.130.0100.01118.62
8.4.120.0110.00924.00
8.4.110.0050.00419.25
8.4.100.0070.00218.13
8.4.90.0090.01020.90
8.4.80.0070.00624.40
8.4.70.0120.00818.99
8.4.60.0130.01120.38
8.4.50.0100.01118.91
8.4.40.0070.01319.46
8.4.30.0030.00618.86
8.4.20.0000.01620.88
8.4.10.0060.01319.55
8.3.260.0040.00516.72
8.3.250.0110.00819.04
8.3.240.0120.00617.24
8.3.230.0140.00516.91
8.3.220.0100.00818.95
8.3.210.0100.00918.71
8.3.200.0030.00616.79
8.3.190.0070.00317.17
8.3.180.0100.00919.09
8.3.170.0120.00617.08
8.3.160.0000.01816.60
8.3.150.0030.00517.52
8.3.140.0030.00716.85
8.3.130.0100.00016.73
8.3.120.0030.00619.00
8.3.110.0060.00320.94
8.3.100.0060.00316.75
8.3.90.0030.00618.61
8.3.80.0070.00318.43
8.3.70.0080.00818.81
8.3.60.0110.00418.33
8.3.50.0140.00716.70
8.3.40.0130.00918.96
8.3.30.0150.00019.08
8.3.20.0080.00021.96
8.3.10.0000.00721.91
8.3.00.0000.00723.36
8.2.290.0130.00720.59
8.2.280.0110.00920.43
8.2.270.0160.00416.52
8.2.260.0090.00917.65
8.2.250.0080.00016.70
8.2.240.0060.00319.18
8.2.230.0060.00322.58
8.2.220.0050.00524.06
8.2.210.0040.00426.77
8.2.200.0090.00018.66
8.2.190.0150.00316.63
8.2.180.0100.00718.66
8.2.170.0130.00922.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00426.16
8.2.110.0090.00022.39
8.2.100.0000.01218.16
8.2.90.0000.00918.00
8.2.80.0040.00419.28
8.2.70.0050.00318.16
8.2.60.0040.00418.28
8.2.50.0030.00618.10
8.2.40.0060.00322.39
8.2.30.0040.00419.56
8.2.20.0050.00318.43
8.2.10.0030.00521.02
8.2.00.0070.00019.47
8.1.330.0060.00422.24
8.1.320.0110.01016.44
8.1.310.0110.00716.79
8.1.300.0080.00017.87
8.1.290.0060.00318.88
8.1.280.0170.00325.92
8.1.270.0060.00322.13
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00522.13
8.1.230.0060.00619.20
8.1.220.0000.00817.91
8.1.210.0100.00018.77
8.1.200.0060.00317.47
8.1.190.0000.00817.60
8.1.180.0030.00518.10
8.1.170.0050.00318.78
8.1.160.0000.00718.97
8.1.150.0040.00419.02
8.1.140.0000.00718.94
8.1.130.0070.00020.24
8.1.120.0080.00317.80
8.1.110.0040.00417.64
8.1.100.0040.00417.82
8.1.90.0000.00817.82
8.1.80.0000.00817.66
8.1.70.0000.00717.71
8.1.60.0000.00817.82
8.1.50.0030.00617.69
8.1.40.0040.00417.79
8.1.30.0000.00817.93
8.1.20.0000.00817.89
8.1.10.0030.00517.67
8.1.00.0060.00317.84
8.0.300.0040.00421.49
8.0.290.0060.00317.00
8.0.280.0070.00018.64
8.0.270.0030.00317.32
8.0.260.0030.00318.54
8.0.250.0030.00317.21
8.0.240.0000.00717.31
8.0.230.0030.00617.20
8.0.220.0040.00417.20
8.0.210.0040.00417.17
8.0.200.0000.00717.26
8.0.190.0070.00017.31
8.0.180.0050.00317.17
8.0.170.0050.00317.29
8.0.160.0000.00817.29
8.0.150.0050.00217.10
8.0.140.0070.00017.13
8.0.130.0030.00313.49
8.0.120.0030.00517.18
8.0.110.0040.00417.11
8.0.100.0040.00417.16
8.0.90.0050.00317.25
8.0.80.0060.01017.15
8.0.70.0040.00417.09
8.0.60.0020.00517.07
8.0.50.0000.00717.20
8.0.30.0130.00617.29
8.0.20.0160.00317.37
8.0.10.0050.00217.24
8.0.00.0090.00917.04
7.4.330.0050.00015.55
7.4.320.0000.00616.77
7.4.300.0000.00616.76
7.4.290.0050.00316.81
7.4.280.0040.00416.84
7.4.270.0040.00516.75
7.4.260.0000.00816.81
7.4.250.0000.00716.77
7.4.240.0020.00516.87
7.4.230.0050.00316.66
7.4.220.0080.00016.64
7.4.210.0080.00716.75
7.4.200.0000.00716.85
7.4.160.0100.00616.87
7.4.130.0110.00716.77
7.4.120.0070.01716.66
7.4.110.0130.01016.71
7.4.100.0060.01216.82
7.4.90.0100.00716.71
7.4.80.0150.00919.39
7.4.70.0120.00616.87
7.4.60.0060.01016.75
7.4.50.0040.01516.88
7.4.40.0160.00716.75
7.4.00.0070.00715.39
7.3.330.0030.00313.61
7.3.320.0070.00013.58
7.3.310.0000.00716.54
7.3.300.0000.00716.61
7.3.290.0040.00416.61
7.3.280.0050.01316.56
7.3.260.0140.00716.77
7.3.240.0120.00816.77
7.3.230.0000.01616.61
7.3.210.0100.00716.86
7.3.200.0100.00716.95
7.3.190.0120.00316.93
7.3.180.0090.00616.73
7.3.170.0090.00916.74
7.3.160.0110.00516.77
7.3.60.0040.00715.11
7.3.50.0090.00615.16
7.3.40.0060.00914.98
7.3.30.0070.00715.09
7.3.20.0110.00416.86
7.3.10.0060.00916.80
7.3.00.0090.00616.91
7.2.330.0060.01216.79
7.2.320.0030.01717.12
7.2.310.0080.01516.92
7.2.300.0040.01317.00
7.2.290.0120.00616.77
7.2.190.0080.00815.37
7.2.180.0090.00315.05
7.2.170.0090.00615.07
7.2.160.0030.01015.31
7.2.150.0030.01217.03
7.2.140.0130.00916.99
7.2.130.0060.00916.85
7.2.120.0070.00716.95
7.2.110.0100.00317.18
7.2.100.0090.00616.87
7.2.90.0050.00916.83
7.2.80.0050.01017.06
7.2.70.0030.01217.12
7.2.60.0070.00717.16
7.2.50.0090.00617.25
7.2.40.0040.01117.02
7.2.30.0100.00316.99
7.2.20.0080.01517.04
7.2.10.0050.00717.04
7.2.00.0100.01317.08
7.1.300.0030.00916.05
7.1.290.0090.00616.04
7.1.280.0060.00815.87
7.1.270.0060.00816.01
7.1.260.0060.01616.00
7.1.250.0060.00615.91

preferences:
143.75 ms | 403 KiB | 5 Q