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'); } }

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.70.0210.00016.75
8.3.60.0110.01118.68
8.3.50.0150.00018.48
8.3.40.0040.01118.97
8.3.30.0120.00318.70
8.3.20.0040.00421.72
8.3.10.0000.00823.66
8.3.00.0040.00423.51
8.2.190.0140.00716.88
8.2.180.0140.00718.54
8.2.170.0090.01219.20
8.2.160.0090.00622.96
8.2.150.0030.00624.18
8.2.140.0070.00024.66
8.2.130.0080.00021.14
8.2.120.0080.00026.35
8.2.110.0040.00422.38
8.2.100.0040.00818.03
8.2.90.0030.00517.88
8.2.80.0000.00819.04
8.2.70.0040.00418.05
8.2.60.0060.00318.16
8.2.50.0060.00318.10
8.2.40.0040.00419.45
8.2.30.0040.00419.34
8.2.20.0060.00318.09
8.2.10.0000.00718.16
8.2.00.0040.00418.24
8.1.280.0070.00725.92
8.1.270.0040.00423.88
8.1.260.0040.00426.35
8.1.250.0060.00628.09
8.1.240.0030.00622.09
8.1.230.0100.00017.77
8.1.220.0030.00617.88
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0090.00017.47
8.1.180.0040.00418.10
8.1.170.0060.00318.71
8.1.160.0000.00718.99
8.1.150.0000.00820.91
8.1.140.0070.00017.63
8.1.130.0000.00919.20
8.1.120.0040.00417.62
8.1.110.0070.00017.55
8.1.100.0030.00817.60
8.1.90.0040.00417.63
8.1.80.0000.00817.57
8.1.70.0030.00317.63
8.1.60.0060.00617.70
8.1.50.0090.00017.68
8.1.40.0000.00817.54
8.1.30.0050.00317.60
8.1.20.0000.00717.66
8.1.10.0060.00317.75
8.1.00.0000.00717.77
8.0.300.0030.00520.08
8.0.290.0080.00016.86
8.0.280.0000.00818.39
8.0.270.0040.00417.39
8.0.260.0000.00617.32
8.0.250.0040.00417.15
8.0.240.0000.00717.14
8.0.230.0030.00317.13
8.0.220.0040.00716.89
8.0.210.0070.00017.00
8.0.200.0030.00317.16
8.0.190.0070.00017.02
8.0.180.0070.00016.99
8.0.170.0030.00617.09
8.0.160.0040.00417.11
8.0.150.0020.00517.11
8.0.140.0050.00316.87
8.0.130.0030.00313.37
8.0.120.0030.00517.09
8.0.110.0000.00817.03
8.0.100.0040.00416.93
8.0.90.0050.00316.95
8.0.80.0040.01517.07
8.0.70.0000.00817.14
8.0.60.0040.00416.98
8.0.50.0060.00317.03
8.0.30.0110.00917.17
8.0.20.0080.01117.40
8.0.10.0040.00417.00
8.0.00.0130.00717.08
7.4.330.0070.00015.55
7.4.320.0070.00016.71
7.4.300.0000.00616.72
7.4.290.0000.00816.67
7.4.280.0050.00316.79
7.4.270.0030.00316.80
7.4.260.0000.00716.77
7.4.250.0000.00716.71
7.4.240.0070.00016.78
7.4.230.0030.00316.52
7.4.220.0040.00416.79
7.4.210.0110.00616.71
7.4.200.0050.00316.77
7.4.160.0070.01116.78
7.4.140.0070.01117.86
7.4.130.0090.00916.63
7.4.120.0120.00816.76
7.4.110.0100.00716.73
7.4.100.0070.01316.79
7.4.90.0060.01616.74
7.4.80.0170.00719.39
7.4.70.0090.00916.79
7.4.60.0150.00816.71
7.4.50.0070.01016.93
7.4.40.0080.00816.52
7.4.00.0060.00615.27
7.3.330.0000.00513.18
7.3.320.0030.00313.46
7.3.310.0040.00416.33
7.3.300.0050.00316.37
7.3.290.0040.00416.31
7.3.280.0080.00716.43
7.3.260.0140.00616.62
7.3.240.0110.00716.63
7.3.230.0160.00516.68
7.3.210.0070.01016.78
7.3.200.0070.01016.79
7.3.190.0120.01216.78
7.3.180.0060.01616.43
7.3.170.0060.00916.66
7.3.160.0040.01116.40
7.2.330.0210.00316.75
7.2.320.0100.01616.78
7.2.310.0110.00716.92
7.2.300.0090.00916.89
7.2.290.0070.01517.07
7.2.40.4230.01617.98
7.2.30.2890.00918.13
7.2.20.3200.01118.07
7.2.10.4750.01317.94
7.2.00.5130.01417.95
7.1.160.3740.01216.52
7.1.150.3300.00917.23
7.1.140.3270.00916.54
7.1.130.5350.01417.10
7.1.120.3100.01316.66
7.1.110.5720.01116.55
7.1.100.3870.00916.63
7.1.90.6460.01416.76
7.1.80.4390.01016.66
7.1.70.5660.00915.76
7.1.60.5550.01333.61
7.1.50.8810.01133.16
7.1.40.8800.01632.86
7.1.30.4160.01832.85
7.1.20.9130.01133.06
7.1.10.8790.01115.07
7.1.00.4490.01015.39

preferences:
19.12 ms | 401 KiB | 5 Q