3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = "2017-01-08"; $stop = "2017-01-20"; $chosenInterval = "week"; function getDates($start, $stop, $chosenInterval = "week") { $startDT = new DateTime($start); $stopDT = new DateTime($stop); if(isset($chosenInterval) && ($chosenInterval == "week" || $chosenInterval == "day") ) { $timeFormat = "F j, Y"; } else { $timeFormat = "F Y"; $chosenInterval = "month"; } $begin = (new DateTime($start))->modify('first day of this month'); $end = (new DateTime($stop))->modify('first day of next month'); $interval = DateInterval::createFromDateString('1 '.$chosenInterval); $period = new DatePeriod($begin, $interval, $end); foreach($period as $dt) { if ($chosenInterval !== "month" && ($dt < $startDT || $dt > $stopDT)) continue; $dataLabels[] = $dt->format($timeFormat); } return $dataLabels; } var_dump(getDates($start, $stop)); var_dump(getDates($start, $stop, "day")); var_dump(getDates($start, $stop, "month"));

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.0090.00916.88
8.3.60.0090.01216.86
8.3.50.0120.00316.50
8.3.40.0120.00618.92
8.3.30.0160.00619.11
8.3.20.0070.00020.34
8.3.10.0060.00320.86
8.3.00.0080.00019.05
8.2.190.0120.00317.00
8.2.180.0110.01118.54
8.2.170.0140.00419.20
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00320.07
8.2.110.0070.00321.09
8.2.100.0000.01218.09
8.2.90.0080.00019.47
8.2.80.0030.00519.38
8.2.70.0060.00317.75
8.2.60.0060.00318.03
8.2.50.0030.00518.41
8.2.40.0050.00320.55
8.2.30.0000.00819.46
8.2.20.0030.00518.23
8.2.10.0070.00018.18
8.2.00.0000.00718.14
8.1.280.0100.00725.92
8.1.270.0060.00323.86
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.00322.18
8.1.230.0060.00620.71
8.1.220.0000.00817.78
8.1.210.0060.00318.77
8.1.200.0000.00917.48
8.1.190.0040.00417.61
8.1.180.0030.00618.10
8.1.170.0040.00418.88
8.1.160.0050.00219.06
8.1.150.0000.00720.37
8.1.140.0000.00719.71
8.1.130.0000.00717.71
8.1.120.0060.00317.75
8.1.110.0030.00517.74
8.1.100.0000.00817.72
8.1.90.0040.00417.78
8.1.80.0000.00717.71
8.1.70.0000.00717.77
8.1.60.0040.00417.80
8.1.50.0050.00317.63
8.1.40.0000.00817.60
8.1.30.0030.00517.88
8.1.20.0030.00617.81
8.1.10.0030.00517.84
8.1.00.0050.00317.75
8.0.300.0060.00318.77
8.0.290.0060.00316.63
8.0.280.0050.00318.59
8.0.270.0040.00417.11
8.0.260.0050.00317.16
8.0.250.0000.00717.21
8.0.240.0030.00617.21
8.0.230.0000.00917.23
8.0.220.0000.00717.15
8.0.210.0040.00417.21
8.0.200.0060.00317.19
8.0.190.0030.00617.25
8.0.180.0100.00017.07
8.0.170.0040.00417.22
8.0.160.0070.00017.06
8.0.150.0040.00417.11
8.0.140.0000.00717.13
8.0.130.0050.00313.50
8.0.120.0000.00717.16
8.0.110.0000.00717.19
8.0.100.0030.00517.18
8.0.90.0000.00817.13
8.0.80.0070.00817.21
8.0.70.0060.00317.02
8.0.60.0080.00017.07
8.0.50.0020.00517.12
8.0.30.0090.01017.19
8.0.20.0110.01017.45
8.0.10.0040.00417.14
8.0.00.0160.00316.98
7.4.330.0050.00015.55
7.4.320.0000.00616.72
7.4.300.0070.00016.82
7.4.290.0070.00016.66
7.4.280.0070.00016.81
7.4.270.0060.00316.82
7.4.260.0000.00716.68
7.4.250.0020.00516.68
7.4.240.0030.00516.79
7.4.230.0000.00816.62
7.4.220.0130.00716.82
7.4.210.0030.01316.75
7.4.200.0040.00416.46
7.4.160.0150.00316.79
7.4.150.0140.00617.40
7.4.140.0100.01217.86
7.4.130.0140.01116.95
7.4.120.0090.01416.67
7.4.110.0060.01316.68
7.4.100.0040.01516.70
7.4.90.0110.00716.82
7.4.80.0110.00719.39
7.4.70.0110.01116.84
7.4.60.0120.01216.83
7.4.50.0110.00216.71
7.4.40.0070.01316.91
7.4.30.0100.01016.83
7.4.00.0100.00715.29
7.3.330.0030.00313.65
7.3.320.0000.00513.50
7.3.310.0080.00016.56
7.3.300.0000.00716.54
7.3.290.0100.00316.53
7.3.280.0080.00816.55
7.3.270.0130.00717.40
7.3.260.0050.01516.65
7.3.250.0120.00916.67
7.3.240.0040.01316.82
7.3.230.0030.02216.87
7.3.210.0070.01116.57
7.3.200.0080.01116.80
7.3.190.0100.00716.69
7.3.180.0120.00616.64
7.3.170.0090.00916.66
7.3.160.0140.00316.64
7.3.120.0120.00315.39
7.3.110.0100.00715.13
7.3.100.0030.00814.88
7.3.90.0100.00715.16
7.3.80.0070.00714.80
7.3.70.0090.00614.70
7.3.60.0000.00915.08
7.3.50.0120.00315.14
7.3.40.0060.00914.86
7.3.30.0040.01115.14
7.3.20.0090.00616.88
7.3.10.0040.01216.98
7.3.00.0070.01016.93
7.2.330.0030.01517.05
7.2.320.0100.00716.86
7.2.310.0190.00016.89
7.2.300.0090.00917.07
7.2.290.0100.00716.98
7.2.240.0110.00615.25
7.2.230.0120.00315.16
7.2.220.0070.01015.20
7.2.210.0000.01715.34
7.2.200.0030.00715.24
7.2.190.0040.01515.41
7.2.180.0040.01215.36
7.2.170.0070.01015.14
7.2.160.0000.01515.27
7.2.150.0080.00417.00
7.2.140.0030.01316.89
7.2.130.0030.01417.22
7.2.120.0090.00317.24
7.2.110.0000.01617.03
7.2.100.0000.01017.17
7.2.90.0090.00617.05
7.2.80.0000.01716.99
7.2.70.0030.01217.02
7.2.60.0050.00917.15
7.2.50.0030.01517.38
7.2.40.0060.00917.21
7.2.30.0070.01016.90
7.2.20.0110.00417.25
7.2.10.0040.01417.00
7.2.00.0060.01017.03
7.1.330.0000.01516.10
7.1.320.0050.00516.02
7.1.310.0060.01016.13
7.1.300.0030.01016.08
7.1.290.0130.00016.14
7.1.280.0000.01115.85
7.1.270.0070.00715.94
7.1.260.0030.01316.14
7.1.250.0120.00615.99
7.1.200.0160.00015.71
7.1.90.0070.00718.10
7.1.80.0000.01618.23
7.1.70.0090.00317.31
7.1.60.0180.00735.48
7.1.50.0130.01335.23
7.1.40.0160.01034.87
7.1.30.0150.01134.81
7.1.20.0130.01334.73
7.1.10.0060.00916.87
7.1.00.0120.00316.85
7.0.230.0030.01118.14
7.0.220.0080.00417.98
7.0.210.0000.01117.00
7.0.200.0090.00317.02
7.0.190.0130.00316.96
7.0.180.0110.00316.49
7.0.170.0080.00516.43
7.0.160.0070.00716.53
7.0.150.0040.01416.15
7.0.140.0000.01316.54
7.0.130.0040.01416.61
7.0.120.0000.01516.87
7.0.110.0030.01316.46
7.0.100.0050.00816.65
7.0.90.0090.00916.47
7.0.80.0060.00916.55
7.0.70.0030.01016.66
7.0.60.0030.01016.33
7.0.50.0100.00316.52
7.0.40.0110.00416.52
7.0.30.0070.00716.64
7.0.20.0070.00716.57
7.0.10.0070.00716.43
7.0.00.0080.00516.44

preferences:
31.25 ms | 401 KiB | 5 Q