3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @param string $start * @param string $end * * @return string[] */ function date_period_grid($start, $end) { $start = new DateTime($start); $end = new DateTime($end); $i = $end->diff($start); $days = $i->days; $months = $i->y * 12 + $i->m + ($i->d ? 1 : 0); $years = $i->y + (($i->m || $i->d) ? 1 : 0); if ($years > 1) { $period = new DatePeriod($start, new DateInterval('P1Y'), $years); } elseif ($months > 1) { $period = new DatePeriod($start, new DateInterval('P1M'), $months); } else { $period = new DatePeriod($start, new DateInterval('P1D'), $days); } $result = []; foreach ($period as $date) { $result[] = $date->form('Y-m-d'); } return $result; } var_dump(date_period_grid('2012-07-01', '2015-11-01'));

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.0070.00716.88
8.3.50.0090.01122.11
8.3.40.0080.00818.72
8.3.30.0090.00618.82
8.3.20.0000.00820.00
8.3.10.0080.00023.53
8.3.00.0080.00019.51
8.2.180.0070.01016.75
8.2.170.0070.00722.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0070.00317.75
8.2.110.0040.00421.09
8.2.100.0080.00418.03
8.2.90.0050.00319.40
8.2.80.0080.00017.97
8.2.70.0060.00317.75
8.2.60.0030.00517.93
8.2.50.0030.00518.07
8.2.40.0000.00819.41
8.2.30.0040.00420.77
8.2.20.0000.00817.89
8.2.10.0000.00818.28
8.2.00.0000.00718.11
8.1.280.0120.00625.92
8.1.270.0080.00023.83
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0110.00021.09
8.1.230.0030.00717.66
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0040.00717.35
8.1.180.0040.00418.10
8.1.170.0040.00418.66
8.1.160.0070.00022.08
8.1.150.0050.00219.00
8.1.140.0030.00519.71
8.1.130.0030.00317.78
8.1.120.0070.00017.68
8.1.110.0080.00017.61
8.1.100.0040.00417.67
8.1.90.0040.00417.64
8.1.80.0000.00817.73
8.1.70.0030.00317.71
8.1.60.0080.00017.75
8.1.50.0000.00817.69
8.1.40.0080.00317.69
8.1.30.0000.00817.84
8.1.20.0030.00517.76
8.1.10.0030.00517.67
8.1.00.0040.00717.80
8.0.300.0000.00818.77
8.0.290.0080.00016.88
8.0.280.0000.00718.46
8.0.270.0000.00717.38
8.0.260.0030.00317.28
8.0.250.0000.00717.27
8.0.240.0000.00717.24
8.0.230.0070.00017.27
8.0.220.0030.00317.15
8.0.210.0000.00717.17
8.0.200.0040.00417.18
8.0.190.0030.00517.16
8.0.180.0000.00717.18
8.0.170.0000.00817.09
8.0.160.0000.00817.18
8.0.150.0000.00717.21
8.0.140.0000.00817.16
8.0.130.0050.00013.55
8.0.120.0000.00817.14
8.0.110.0000.00717.06
8.0.100.0020.00517.17
8.0.90.0040.00417.21
8.0.80.0040.01117.14
8.0.70.0000.00817.15
8.0.60.0080.00017.30
8.0.50.0000.00717.07
8.0.30.0160.00217.31
8.0.20.0120.00917.44
8.0.10.0050.00317.22
8.0.00.0100.00717.08
7.4.330.0000.00615.08
7.4.320.0040.00416.67
7.4.300.0030.00316.79
7.4.290.0000.00716.77
7.4.280.0040.00416.76
7.4.270.0070.00016.68
7.4.260.0000.00716.66
7.4.250.0040.00416.72
7.4.240.0040.00316.74
7.4.230.0040.00416.62
7.4.220.0110.01116.67
7.4.210.0080.00616.62
7.4.200.0000.00716.78
7.4.160.0060.01016.64
7.4.150.0070.01717.40
7.4.140.0170.01217.86
7.4.130.0090.00816.66
7.4.120.0110.00716.79
7.4.110.0000.01616.66
7.4.100.0100.00716.77
7.4.90.0080.00816.77
7.4.80.0130.00319.39
7.4.70.0140.00716.66
7.4.60.0140.00316.69
7.4.50.0040.00016.57
7.4.40.0040.01216.79
7.4.30.0090.01216.70
7.4.10.0070.00715.29
7.4.00.0120.00515.31
7.3.330.0000.00813.34
7.3.320.0030.00313.59
7.3.310.0040.00416.57
7.3.300.0000.00716.38
7.3.290.0050.01016.53
7.3.280.0070.01016.54
7.3.270.0130.00517.40
7.3.260.0090.00916.58
7.3.250.0050.01316.65
7.3.240.0070.01316.83
7.3.230.0070.01016.70
7.3.210.0070.01016.61
7.3.200.0060.01216.67
7.3.190.0090.00616.58
7.3.180.0000.01616.51
7.3.170.0130.00916.94
7.3.160.0110.00616.76
7.3.130.0060.01315.06
7.3.120.0030.01515.12
7.3.110.0090.00615.05
7.3.100.0060.00614.86
7.3.90.0090.00615.08
7.3.80.0060.00314.92
7.3.70.0000.01514.86
7.3.60.0030.01014.77
7.3.50.0080.00614.97
7.3.40.0100.00315.13
7.3.30.0140.00315.03
7.3.20.0030.01016.55
7.3.10.0030.01016.96
7.3.00.0000.01316.87
7.2.330.0040.01417.04
7.2.320.0060.01616.88
7.2.310.0140.00316.55
7.2.300.0140.00416.97
7.2.290.0110.00516.91
7.2.260.0110.01115.18
7.2.250.0080.01115.19
7.2.240.0030.00915.30
7.2.230.0080.00415.14
7.2.220.0000.01615.36
7.2.210.0070.00715.02
7.2.200.0030.01015.29
7.2.190.0090.00015.27
7.2.180.0090.00315.27
7.2.170.0000.01714.99
7.2.160.0070.01015.13
7.2.150.0040.00817.24
7.2.140.0030.00917.04
7.2.130.0070.01017.12
7.2.120.0110.00717.23
7.2.110.0040.01117.13
7.2.100.0030.01217.08
7.2.90.0070.01016.89
7.2.80.0070.01316.97
7.2.70.0040.01216.89
7.2.60.0060.00617.17
7.2.50.0030.01017.20
7.2.40.0060.00617.20
7.2.30.0030.00617.09
7.2.20.0030.01317.09
7.2.10.0060.00617.13
7.2.00.0080.00817.06
7.1.330.0000.01616.11
7.1.320.0030.00715.92
7.1.310.0030.01016.09
7.1.300.0030.01015.95
7.1.290.0100.00715.65
7.1.280.0090.00616.02
7.1.270.0060.00615.78
7.1.260.0060.00616.03
7.1.250.0030.00715.71
7.1.240.0070.00315.98
7.1.230.0100.00716.01
7.1.220.0120.00615.65
7.1.210.0030.01016.11
7.1.200.0050.00715.85
7.1.190.0020.01015.86
7.1.180.0030.00516.15
7.1.170.0040.00415.98
7.1.160.0080.00416.03
7.1.150.0000.01415.79
7.1.140.0090.00616.00
7.1.130.0090.00315.87
7.1.120.0030.00615.91
7.1.110.0060.00615.93
7.1.100.0070.00716.16
7.1.90.0070.00315.92
7.1.80.0030.00915.91
7.1.70.0030.00816.52
7.1.60.0070.00716.75
7.1.50.0050.01716.46
7.1.40.0040.01216.01
7.1.30.0040.01115.87
7.1.20.0110.00015.95
7.1.10.0120.00315.87
7.1.00.0060.03819.14
7.0.330.0060.00315.68
7.0.320.0110.00615.68
7.0.310.0070.00715.61
7.0.300.0130.00315.48
7.0.290.0070.00415.38
7.0.280.0090.00615.36
7.0.270.0040.00815.50
7.0.260.0090.00315.23
7.0.250.0040.01115.57
7.0.240.0080.00815.39
7.0.230.0100.00315.36
7.0.220.0130.00015.29
7.0.210.0030.01215.67
7.0.200.0060.00616.25
7.0.190.0030.01415.43
7.0.180.0040.00815.33
7.0.170.0030.01015.74
7.0.160.0040.01115.63
7.0.150.0030.00915.71
7.0.140.0060.00615.66
7.0.130.0070.01015.38
7.0.120.0060.00815.54
7.0.110.0090.00015.66
7.0.100.0040.01115.77
7.0.90.0060.00915.57
7.0.80.0000.01115.46
7.0.70.0070.01015.61
7.0.60.0050.03217.77
7.0.50.0060.02316.88
7.0.40.0020.03316.77
7.0.30.0110.02916.96
7.0.20.0250.02716.76
7.0.10.0070.02716.89
7.0.00.0090.02116.69
5.6.400.0000.00914.47
5.6.390.0040.00414.62
5.6.380.0100.00714.22
5.6.370.0040.00814.80
5.6.360.0090.00614.31
5.6.350.0030.01314.15
5.6.340.0000.00814.69
5.6.330.0040.01114.80
5.6.320.0060.00614.84
5.6.310.0060.00614.43
5.6.300.0040.01214.35
5.6.290.0060.01014.56
5.6.280.0060.03517.73
5.6.270.0040.00414.46
5.6.260.0000.01114.66
5.6.250.0040.00414.32
5.6.240.0070.00314.46
5.6.230.0070.00714.82
5.6.220.0030.00714.64
5.6.210.0050.04017.44
5.6.200.0090.04316.37
5.6.190.0070.04317.31
5.6.180.0180.02517.53
5.6.170.0190.03817.31
5.6.160.0080.02017.54
5.6.150.0020.05016.29
5.6.140.0000.04716.29
5.6.130.0030.02516.47
5.6.120.0050.03117.71
5.6.110.0150.01717.63
5.6.100.0100.03517.86
5.6.90.0080.02217.79
5.6.80.0050.03317.50
5.6.70.0110.00314.50
5.6.60.0040.00814.55
5.6.50.0000.01414.24
5.6.40.0060.00614.28
5.6.30.0040.00414.18
5.6.20.0070.00714.53
5.6.10.0030.01514.44
5.6.00.0060.00614.25
5.5.380.0060.00614.46
5.5.370.0100.00714.52
5.5.360.0030.01014.46
5.5.350.0180.03717.38
5.5.340.0120.04016.27
5.5.330.0060.03617.49
5.5.320.0130.01917.22
5.5.310.0140.02217.35
5.5.300.0060.02616.13
5.5.290.0050.02816.19
5.5.280.0050.04317.68
5.5.270.0100.03317.60
5.5.260.0080.03417.57
5.5.250.0110.02317.53
5.5.240.0110.03817.26
5.5.230.0040.00814.32
5.5.220.0070.00714.49
5.5.210.0080.00014.15
5.5.200.0060.00614.30
5.5.190.0040.00714.31
5.5.180.0070.01114.33
5.5.170.0070.00714.21
5.5.160.0060.00614.62
5.5.150.0040.01214.21
5.5.140.0070.00714.48
5.5.130.0080.00814.66
5.5.120.0040.00814.42
5.5.110.0090.00314.58
5.5.100.0030.00914.54
5.5.90.0040.01114.55
5.5.80.0080.00514.50
5.5.70.0060.00914.44
5.5.60.0060.00614.48
5.5.50.0100.00314.17
5.5.40.0030.01014.46
5.5.30.0090.00614.52
5.5.20.0080.00614.21
5.5.10.0000.01014.19
5.5.00.0060.00614.38
5.4.450.0230.02015.47
5.4.440.0200.03415.53
5.4.430.0230.02615.45
5.4.420.0270.03615.36
5.4.410.0230.02315.35
5.4.400.0220.02215.33
5.4.390.0260.02915.28
5.4.380.0190.02415.15
5.4.370.0220.03415.20
5.4.360.0320.03015.23
5.4.350.0240.02315.18
5.4.340.0260.02215.17
5.4.330.0000.00711.41
5.4.320.0270.03715.32
5.4.310.0280.02715.24
5.4.300.0220.02215.24
5.4.290.0280.03515.13
5.4.280.0340.03315.27
5.4.270.0280.03515.24
5.4.260.0250.02915.31
5.4.250.0350.02615.27
5.4.240.0250.03015.19
5.4.230.0320.03615.30
5.4.220.0340.03415.18
5.4.210.0300.03615.32
5.4.200.0320.02915.34
5.4.190.0270.02615.14
5.4.180.0310.03115.24
5.4.170.0360.02115.13
5.4.160.0270.03815.29
5.4.150.0300.01815.28
5.4.140.0270.02713.97
5.4.130.0250.02014.04
5.4.120.0230.02214.08
5.4.110.0250.02813.80
5.4.100.0300.03413.89
5.4.90.0330.03113.98
5.4.80.0000.01111.41
5.4.70.0030.00911.41
5.4.60.0060.00611.41
5.4.50.0060.00011.41
5.4.40.0040.00411.41
5.4.30.0040.00811.41
5.4.20.0080.00611.41
5.4.10.0080.00311.41
5.4.00.0000.01011.41

preferences:
48.97 ms | 401 KiB | 5 Q