3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getIntervals($start_date, $end_date, $period) { $period_formats = array( 'day' => 'Y-m-d', 'week' => 'Y-W', 'month' => 'Y-m', 'year' => 'Y' ); $start = new DateTime($start_date); if($period != 'day') { $start->modify('first day of this '.$period); } $end = new DateTime($end_date); if($period != 'day') { $end->modify('first day of next '.$period); } $interval = DateInterval::createFromDateString('1 '.$period); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo "pf: ".$period_formats[$period]; echo $dt->format($period_formats[$period]) . "<br>\n"; } } getIntervals('2014-06-01', '2014-10-18', '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.60.0110.00418.46
8.3.50.0110.01122.16
8.3.40.0150.00719.10
8.3.30.0100.00319.09
8.3.20.0070.00720.29
8.3.10.0080.00023.65
8.3.00.0070.00417.88
8.2.180.0080.01118.54
8.2.170.0140.00722.96
8.2.160.0100.00320.48
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00822.41
8.2.110.0070.00422.38
8.2.100.0110.00017.97
8.2.90.0060.00319.83
8.2.80.0030.00619.21
8.2.70.0040.00417.88
8.2.60.0160.00017.93
8.2.50.0000.01018.07
8.2.40.0000.00819.88
8.2.30.0000.00818.21
8.2.20.0040.00418.00
8.2.10.0080.00018.16
8.2.00.0040.00717.91
8.1.280.0140.00725.92
8.1.270.0080.00023.93
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00722.73
8.1.230.0090.00320.92
8.1.220.0000.00817.91
8.1.210.0050.00318.77
8.1.200.0030.00617.49
8.1.190.0000.00817.50
8.1.180.0030.00618.10
8.1.170.0000.00818.82
8.1.160.0040.00422.09
8.1.150.0060.00319.04
8.1.140.0040.00417.71
8.1.130.0050.00317.89
8.1.120.0030.00417.79
8.1.110.0000.00717.61
8.1.100.0050.00217.69
8.1.90.0040.00417.70
8.1.80.0000.00717.71
8.1.70.0030.00317.70
8.1.60.0030.01017.79
8.1.50.0000.00817.59
8.1.40.0040.00417.67
8.1.30.0050.00517.79
8.1.20.0000.00817.71
8.1.10.0050.00317.74
8.1.00.0040.00417.78
8.0.300.0000.00720.17
8.0.290.0040.00417.00
8.0.280.0030.00318.48
8.0.270.0000.00717.39
8.0.260.0070.00017.36
8.0.250.0000.00717.27
8.0.240.0000.00717.15
8.0.230.0070.00017.28
8.0.220.0070.00017.13
8.0.210.0070.00017.09
8.0.200.0030.00317.18
8.0.190.0000.00817.30
8.0.180.0070.00017.20
8.0.170.0060.00317.21
8.0.160.0050.00317.22
8.0.150.0060.00317.08
8.0.140.0060.00317.19
8.0.130.0090.00013.59
8.0.120.0040.00417.22
8.0.110.0000.00717.22
8.0.100.0040.00417.21
8.0.90.0000.00717.13
8.0.80.0110.01117.21
8.0.70.0030.00517.07
8.0.60.0080.00017.11
8.0.50.0000.00717.24
8.0.30.0100.01017.20
8.0.20.0110.01117.50
8.0.10.0030.00517.30
8.0.00.0040.01317.24
7.4.330.0030.00315.27
7.4.320.0000.00816.86
7.4.300.0000.00616.56
7.4.290.0030.00516.72
7.4.280.0060.00316.81
7.4.270.0000.00716.61
7.4.260.0030.00516.84
7.4.250.0050.00316.58
7.4.240.0050.00216.78
7.4.230.0000.00816.84
7.4.220.0170.00316.83
7.4.210.0090.00616.89
7.4.200.0000.00816.64
7.4.160.0070.01116.67
7.4.150.0100.01417.40
7.4.140.0110.01317.86
7.4.130.0130.01316.74
7.4.120.0150.01116.81
7.4.110.0120.01916.69
7.4.100.0130.00716.93
7.4.90.0120.01216.82
7.4.80.0130.01719.39
7.4.70.0150.00516.89
7.4.60.0060.01216.68
7.4.50.0000.00616.77
7.4.40.0060.01316.67
7.4.30.0030.01716.68
7.4.00.0070.01015.31
7.3.330.0030.00513.55
7.3.320.0000.00513.57
7.3.310.0040.00416.66
7.3.300.0000.00716.49
7.3.290.0080.00816.63
7.3.280.0090.01216.62
7.3.270.0160.00917.40
7.3.260.0090.01216.78
7.3.250.0140.00716.70
7.3.240.0090.01816.74
7.3.230.0120.00916.69
7.3.210.0120.00916.86
7.3.200.0140.00619.39
7.3.190.0100.01016.65
7.3.180.0090.00916.84
7.3.170.0130.00916.64
7.3.160.0060.01216.80
7.3.10.0060.00916.93
7.3.00.0000.01617.03
7.2.330.0140.01117.13
7.2.320.0060.02317.07
7.2.310.0100.01016.90
7.2.300.0060.01317.04
7.2.290.0040.01616.71
7.2.130.0110.00717.30
7.2.120.0110.00417.24
7.2.110.0140.00417.17
7.2.100.0060.01217.32
7.2.90.0090.00917.10
7.2.80.0130.00317.35
7.2.70.0080.00817.33
7.2.60.0040.01017.09
7.2.50.0150.00317.23
7.2.40.0080.00417.18
7.2.30.0040.01117.25
7.2.20.0140.00316.97
7.2.10.0070.00716.99
7.2.00.0050.00517.37
7.1.250.0040.00815.86
7.1.200.0090.00315.96
7.1.70.0000.00917.48
7.1.60.0200.00719.32
7.1.50.0060.00917.27
7.1.00.0030.07322.41
7.0.200.0000.00817.16
7.0.140.0030.07322.12
7.0.60.0070.07719.85
7.0.50.0130.07017.90
7.0.40.0030.04320.02
7.0.30.0070.05020.32
7.0.20.0270.07020.25
7.0.10.0030.09020.04
7.0.00.0130.07320.18
5.6.280.0130.06721.15
5.6.210.0130.07320.54
5.6.200.0100.08718.17
5.6.190.0130.06020.57
5.6.180.0000.04320.61
5.6.170.0270.05720.62
5.6.160.0070.04320.43
5.6.150.0070.08318.19
5.6.140.0070.05718.18
5.6.130.0030.04318.28
5.6.120.0070.08321.02
5.6.110.0030.06721.05
5.6.100.0100.06321.01
5.6.90.0100.07320.97
5.6.80.0070.07020.38
5.6.70.4100.03020.38
5.5.350.0130.07720.41
5.5.340.0070.08718.09
5.5.330.0070.04020.41
5.5.320.0400.07720.24
5.5.310.0230.04020.30
5.5.300.0100.08017.98
5.5.290.0100.07717.92
5.5.280.0100.08020.98
5.5.270.0100.07320.76
5.5.260.0100.08720.68
5.5.250.0100.07720.59
5.5.240.0070.07020.29
5.4.450.0670.04719.58
5.4.440.0230.05319.46
5.4.430.0570.04719.47
5.4.420.0700.00019.55
5.4.410.0700.00019.41
5.4.400.0630.00019.34
5.4.390.0630.00019.26
5.4.380.0630.00019.21
5.4.370.0670.00019.16
5.4.360.0670.00019.12
5.4.350.0670.00019.13
5.4.340.0060.04312.02
5.4.320.0080.03912.51
5.4.310.0100.04012.50
5.4.300.0050.04112.51
5.4.290.0060.04412.50
5.4.280.0070.03612.40
5.4.270.0080.03912.40
5.4.260.0040.04212.40
5.4.250.0080.05012.40
5.4.240.0120.03512.40
5.4.230.0070.04612.39
5.4.220.0070.03712.39
5.4.210.0070.03812.40
5.4.200.0040.04212.40
5.4.190.0040.04212.39
5.4.180.0050.04112.39
5.4.170.0060.04012.40
5.4.160.0090.03812.39
5.4.150.0100.03612.39
5.4.140.0110.03812.07
5.4.130.0070.03812.06
5.4.120.0060.04012.02
5.4.110.0080.04212.02
5.4.100.0070.03912.02
5.4.90.0090.04412.02
5.4.80.0050.04012.02
5.4.70.0050.03812.02
5.4.60.0090.03612.01
5.4.50.0080.04012.01
5.4.40.0050.03912.00
5.4.30.0100.03711.99
5.4.20.0070.03911.99
5.4.10.0040.04311.99
5.4.00.0090.03711.48
5.3.290.0080.04812.80
5.3.280.0080.05112.71
5.3.270.0080.04812.72
5.3.260.0060.04912.72
5.3.250.0080.04212.72
5.3.240.0070.04012.72
5.3.230.0120.03512.70
5.3.220.0060.04212.68
5.3.210.0070.04412.68
5.3.200.0070.04612.68
5.3.190.0100.03612.68
5.3.180.0080.03712.67
5.3.170.0060.03912.67
5.3.160.0050.04512.68
5.3.150.0070.04012.68
5.3.140.0090.04512.66
5.3.130.0060.04312.66
5.3.120.0090.04112.66
5.3.110.0050.04312.66
5.3.100.0070.04412.13
5.3.90.0130.03512.11
5.3.80.0030.04112.09
5.3.70.0110.03512.09
5.3.60.0090.04312.08
5.3.50.0100.03712.03
5.3.40.0100.03612.03
5.3.30.0090.03411.99
5.3.20.0050.03911.77
5.3.10.0090.04011.73
5.3.00.0060.04511.72
5.2.170.0030.0369.23
5.2.160.0060.0319.23
5.2.150.0090.0279.23
5.2.140.0040.0369.22
5.2.130.0090.0259.18
5.2.120.0050.0289.19
5.2.110.0070.0369.19
5.2.100.0070.0279.18
5.2.90.0070.0279.19
5.2.80.0060.0379.18
5.2.70.0080.0329.18
5.2.60.0040.0339.13
5.2.50.0020.0349.10
5.2.40.0070.0279.08
5.2.30.0060.0289.05
5.2.20.0060.0329.05
5.2.10.0080.0318.95
5.2.00.0070.0298.82
5.1.60.0060.0308.09
5.1.50.0060.0268.09
5.1.40.0050.0248.07
5.1.30.0050.0338.42
5.1.20.0050.0278.44
5.1.10.0070.0248.17
5.1.00.0010.0298.17
5.0.50.0040.0206.66
5.0.40.0020.0216.52
5.0.30.0030.0326.34
5.0.20.0040.0216.29
5.0.10.0040.0196.28
5.0.00.0040.0306.27
4.4.90.0040.0174.78
4.4.80.0040.0194.76
4.4.70.0050.0164.75
4.4.60.0050.0144.75
4.4.50.0030.0204.77
4.4.40.0030.0254.70
4.4.30.0030.0164.76
4.4.20.0040.0154.84
4.4.10.0030.0154.84
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0010.0194.66
4.3.90.0050.0184.64
4.3.80.0050.0274.58
4.3.70.0020.0174.63
4.3.60.0000.0184.63
4.3.50.0020.0164.63
4.3.40.0020.0264.54
4.3.30.0010.0173.32
4.3.20.0010.0183.29
4.3.10.0050.0153.26
4.3.00.0000.01710.13

preferences:
42.89 ms | 401 KiB | 5 Q