3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = new DateTime('2016-01-01'); $reportEndDate = new DateTime('2016-05-31'); $months = $currentDate->diff($reportEndDate)->m; var_export($months); var_export(\n); for ($i = 1; $i <= $months ; $i++) { $currentDateImmutable = \DateTimeImmutable::createFromMutable($currentDate); $daysUntilNextMonth = $currentDateImmutable->diff($currentDateImmutable->modify('last day of this month'))->d; var_export($daysUntilNextMonth); var_export("\n"); for ($j = 1; $j <= $daysUntilNextMonth ; $j++) { $currentDate->modify('+1 day'); } var_dump($currentDate); }

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.60.0120.00918.44
8.3.50.0070.00718.37
8.3.40.0060.00918.97
8.3.30.0040.01118.92
8.3.20.0040.00421.95
8.3.10.0060.00323.66
8.3.00.0040.00423.66
8.2.180.0090.01218.79
8.2.170.0120.00319.04
8.2.160.0080.00622.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00421.09
8.2.120.0040.00426.35
8.2.110.0030.00622.18
8.2.100.0090.00317.97
8.2.90.0080.00017.75
8.2.80.0040.00419.03
8.2.70.0040.00417.80
8.2.60.0030.00618.09
8.2.50.0030.00618.10
8.2.40.0050.00319.33
8.2.30.0050.00219.30
8.2.20.0060.00318.12
8.2.10.0070.00018.17
8.2.00.0000.00818.18
8.1.280.0040.01125.92
8.1.270.0080.00023.78
8.1.260.0070.00026.35
8.1.250.0140.00028.09
8.1.240.0000.00822.23
8.1.230.0070.00417.70
8.1.220.0000.00817.80
8.1.210.0000.00918.77
8.1.200.0040.00417.25
8.1.190.0090.00017.48
8.1.180.0060.00318.10
8.1.170.0000.00818.77
8.1.160.0040.00418.87
8.1.150.0070.00020.80
8.1.140.0040.00417.68
8.1.130.0000.00819.10
8.1.120.0040.00417.65
8.1.110.0040.00417.51
8.1.100.0050.00517.52
8.1.90.0070.00017.56
8.1.80.0040.00417.66
8.1.70.0030.00517.54
8.1.60.0040.00717.78
8.1.50.0000.00817.59
8.1.40.0060.00317.67
8.1.30.0030.00517.74
8.1.20.0090.00017.70
8.1.10.0000.00917.61
8.1.00.0040.00417.57
8.0.300.0000.00820.04
8.0.290.0060.00316.88
8.0.280.0000.00718.53
8.0.270.0000.00817.41
8.0.260.0030.00317.34
8.0.250.0000.00717.23
8.0.240.0030.00317.11
8.0.230.0030.00317.10
8.0.220.0030.00717.04
8.0.210.0070.00017.06
8.0.200.0000.00617.09
8.0.190.0030.00617.09
8.0.180.0080.00017.07
8.0.170.0060.00317.14
8.0.160.0020.00517.20
8.0.150.0080.00016.97
8.0.140.0000.00817.14
8.0.130.0030.00313.44
8.0.120.0000.01017.11
8.0.110.0030.00617.16
8.0.100.0030.00517.10
8.0.90.0030.00617.16
8.0.80.0090.00617.11
8.0.70.0040.00417.06
8.0.60.0070.00017.07
8.0.50.0000.00817.14
8.0.30.0140.00517.13
8.0.20.0120.00617.40
8.0.10.0000.00817.16
8.0.00.0080.01417.13
7.4.330.0030.00315.55
7.4.320.0060.00016.70
7.4.300.0000.00616.59
7.4.290.0000.00716.63
7.4.280.0030.00516.61
7.4.270.0080.00016.64
7.4.260.0070.00016.75
7.4.250.0000.00716.73
7.4.240.0030.00316.67
7.4.230.0040.00416.75
7.4.220.0000.00816.77
7.4.210.0090.00516.65
7.4.200.0040.00316.84
7.4.160.0090.00616.60
7.4.140.0100.00817.86
7.4.130.0090.00916.82
7.4.120.0130.00516.81
7.4.110.0110.00616.59
7.4.100.0030.01616.79
7.4.90.0070.01016.81
7.4.80.0110.01119.39
7.4.70.0160.00316.87
7.4.60.0030.01716.81
7.4.50.0000.01416.60
7.4.40.0080.00816.59
7.4.10.0040.01116.32
7.4.00.0110.00815.96
7.3.330.0000.00513.33
7.3.320.0060.00013.10
7.3.310.0030.00316.42
7.3.300.0040.00416.41
7.3.290.0060.00016.45
7.3.280.0090.00816.42
7.3.260.0130.00716.54
7.3.240.0110.00916.57
7.3.230.0140.00416.52
7.3.210.0090.00916.50
7.3.200.0100.01016.51
7.3.190.0130.00716.47
7.3.180.0100.00516.64
7.3.170.0120.00416.42
7.3.160.0080.00816.64
7.3.130.0070.01316.64
7.3.120.0090.00916.58
7.3.110.0110.00416.60
7.3.100.0060.00916.57
7.3.90.0030.01016.50
7.3.80.0100.00016.44
7.3.70.0070.00716.32
7.3.60.0030.01216.32
7.3.50.0060.00616.45
7.3.40.0040.00816.49
7.3.30.0080.00816.38
7.3.20.0000.01318.20
7.3.10.0070.00717.97
7.3.00.0080.00618.34
7.2.330.0030.01416.86
7.2.320.0160.00616.73
7.2.310.0080.01216.57
7.2.300.0100.00716.63
7.2.290.0110.00916.84
7.2.260.0070.01016.84
7.2.250.0040.01816.60
7.2.240.0090.00316.80
7.2.230.0030.00916.80
7.2.220.0060.00816.50
7.2.210.0080.00816.61
7.2.200.0090.00616.73
7.2.190.0070.00716.81
7.2.180.0080.00316.79
7.2.170.0110.00416.73
7.2.160.0060.00916.58
7.2.150.0080.00518.51
7.2.140.0000.01318.43
7.2.130.0100.00718.51
7.2.120.0030.01218.51
7.2.110.0000.01218.44
7.2.100.0040.00818.34
7.2.90.0030.01118.58
7.2.80.0000.01318.36
7.2.70.0090.00618.57
7.2.60.0090.00617.69
7.2.50.0040.00917.88
7.2.40.2550.00818.22
7.2.30.1630.00918.29
7.2.20.1690.01018.20
7.2.10.0120.00918.21
7.2.00.0140.00818.32
7.1.330.0030.01017.40
7.1.320.0040.00817.43
7.1.310.0060.00617.63
7.1.300.0070.01017.52
7.1.290.0080.00317.63
7.1.280.0070.00717.48
7.1.270.0050.00817.54
7.1.260.0030.00617.21
7.1.250.0030.00617.48
7.1.240.0000.00917.36
7.1.230.0030.00717.46
7.1.220.0030.00617.18
7.1.210.0060.00317.43
7.1.200.0090.00316.69
7.1.190.0030.01217.38
7.1.180.0090.00617.39
7.1.170.0000.01117.58
7.1.160.2030.01116.97
7.1.150.1460.01016.82
7.1.140.1930.00817.13
7.1.130.0080.00917.12
7.1.120.0100.00817.14
7.1.110.1370.01016.74
7.1.100.1480.00916.88
7.1.90.2710.01116.81
7.1.80.2540.00616.94
7.1.70.2520.00916.54
7.1.60.2120.01025.33
7.1.50.2300.01325.24
7.1.40.2540.00825.11
7.1.30.2290.01225.10
7.1.20.2210.00925.20
7.1.10.2280.01016.31
7.1.00.1320.01016.12
7.0.330.0120.00317.16
7.0.320.0070.00717.19
7.0.310.0090.00617.08
7.0.300.0060.00316.94
7.0.290.0070.00417.04
7.0.280.0100.00317.05
7.0.270.0040.00417.09
7.0.260.0070.01017.10
7.0.250.0070.00717.27
7.0.240.0050.00517.19
7.0.230.0050.00516.93
7.0.220.0090.00617.04
7.0.210.0030.01017.02
7.0.200.0030.00717.05
7.0.190.0060.00317.15
7.0.180.0070.00717.14
7.0.170.0030.00917.12
7.0.160.0040.00716.96
7.0.150.0000.01517.05
7.0.140.0070.00717.21
7.0.130.0100.00317.24
7.0.120.0030.00617.18
7.0.110.0070.00317.04
7.0.100.0030.01117.23
7.0.90.0070.00717.13
7.0.80.0090.00617.18
7.0.70.0070.00317.06
7.0.60.0060.00917.07
7.0.50.0100.00017.12
7.0.40.0000.00915.10
7.0.30.0070.00715.24
7.0.20.0040.01114.92
7.0.10.0090.00615.14
7.0.00.0070.00315.04
5.6.400.0040.01115.97
5.6.390.0040.01116.08
5.6.380.0100.00315.86
5.6.370.0090.00315.79
5.6.360.0060.00316.18
5.6.350.0030.00915.83
5.6.340.0120.00415.84
5.6.330.0000.01015.98
5.6.320.0060.00616.09
5.6.310.0040.00816.02
5.6.300.0090.00916.04
5.6.290.0030.01315.80
5.6.280.0030.01215.93
5.6.270.0070.00715.99
5.6.260.0060.01015.99
5.6.250.0100.00716.03
5.6.240.0040.00715.77
5.6.230.0070.00716.14
5.6.220.0120.00316.06
5.6.210.0030.01215.90
5.6.200.0040.00815.70
5.6.190.0000.01315.86
5.6.180.0030.01316.04
5.6.170.0030.01316.03
5.6.160.0050.00515.92
5.6.150.0040.00415.86
5.6.140.0070.00415.93
5.6.130.0070.00715.86
5.6.120.0030.01216.03
5.6.110.0040.00815.80
5.6.100.0000.00915.80
5.6.90.0040.01015.96
5.6.80.0070.00715.89
5.6.70.0030.00715.83
5.6.60.0000.01315.86
5.6.50.0030.00615.67
5.6.40.0100.00315.88
5.6.30.0100.00715.95
5.6.20.0070.00715.86
5.6.10.0090.00615.85
5.6.00.0040.01115.97

preferences:
53.62 ms | 400 KiB | 5 Q