3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLineChartPromedio($format = 'Y-m-d'){ $startDate = '2020-07-08'; //$this->input->post('startDate'); $endDate = '2020-07-12'; //$this->input->post('endDate'); // Declare an empty array $arraydias = array(); // Variable that store the date interval // of period 1 day $interval = new DateInterval('P1D'); $realEnd = new DateTime($endDate); $realEnd->add($interval); $period = new DatePeriod(new DateTime($startDate), $interval, $realEnd); // Use loop to store date into array foreach($period as $date) { $fecha = $date->format($format); $arraydias[] = $fecha; } $string = "'" . implode("','", $arraydias) . "'"; echo json_encode($string); } getLineChartPromedio();

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.120.0090.00919.03
8.3.110.0060.00320.94
8.3.100.0000.00724.06
8.3.90.0080.00026.77
8.3.80.0000.00816.63
8.3.70.0150.00016.63
8.3.60.0110.00716.62
8.3.50.0070.00924.64
8.3.40.0060.01218.95
8.3.30.0040.01119.10
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.240.0110.00017.27
8.2.230.0110.00322.58
8.2.220.0000.00837.54
8.2.210.0110.00426.77
8.2.200.0060.00316.88
8.2.190.0040.01116.63
8.2.180.0110.01125.92
8.2.170.0070.00718.89
8.2.160.0150.00622.96
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00926.35
8.2.110.0080.00322.26
8.2.100.0080.00317.91
8.2.90.0030.00519.35
8.2.80.0060.00317.97
8.2.70.0000.00817.88
8.2.60.0030.00618.05
8.2.50.0030.00518.07
8.2.40.0040.00420.07
8.2.30.0060.00318.17
8.2.20.0030.00618.06
8.2.10.0040.00419.25
8.2.00.0040.00419.25
8.1.290.0050.00518.88
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0000.01021.03
8.1.230.0060.00617.95
8.1.220.0040.00417.78
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0000.00819.01
8.1.150.0040.00418.94
8.1.140.0050.00218.95
8.1.130.0000.00719.45
8.1.120.0030.00617.62
8.1.110.0030.00717.62
8.1.100.0000.00717.53
8.1.90.0020.00517.55
8.1.80.0000.00817.48
8.1.70.0070.00017.50
8.1.60.0080.00017.60
8.1.50.0040.00417.61
8.1.40.0000.00817.55
8.1.30.0050.00317.79
8.1.20.0040.00417.78
8.1.10.0000.00717.68
8.1.00.0040.00417.58
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0030.00318.43
8.0.270.0000.00718.21
8.0.260.0070.00016.95
8.0.250.0020.00517.15
8.0.240.0030.00317.17
8.0.230.0030.00317.19
8.0.220.0000.00717.16
8.0.210.0000.00917.16
8.0.200.0000.00717.01
8.0.190.0000.00717.09
8.0.180.0000.00817.13
8.0.170.0000.00817.00
8.0.160.0080.00017.13
8.0.150.0040.00417.03
8.0.140.0030.00516.95
8.0.130.0050.00013.42
8.0.120.0030.00516.99
8.0.110.0040.00417.14
8.0.100.0050.00216.96
8.0.90.0050.00216.99
8.0.80.0040.01117.04
8.0.70.0050.00317.16
8.0.60.0040.00417.09
8.0.50.0070.00016.91
8.0.30.0040.01217.19
8.0.20.0060.01517.20
8.0.10.0000.00717.22
8.0.00.0140.00716.96
7.4.330.0030.00316.77
7.4.320.0060.00016.74
7.4.300.0070.00016.65
7.4.290.0030.00316.55
7.4.280.0040.00416.63
7.4.270.0030.00516.74
7.4.260.0050.00013.36
7.4.250.0030.00316.70
7.4.240.0000.00716.64
7.4.230.0070.00016.64
7.4.220.0040.00416.64
7.4.210.0060.01116.59
7.4.200.0070.00016.85
7.4.130.0090.00916.64
7.4.120.0100.01016.94
7.4.110.0090.00916.89
7.4.100.0070.01116.85
7.4.90.0100.00716.69
7.4.80.0090.01216.66
7.4.70.0100.00716.68
7.4.60.0060.01316.50
7.4.50.0070.01716.67
7.4.40.0120.00616.73
7.4.30.0170.00016.74
7.4.20.0030.01816.70
7.4.10.0070.01116.56
7.4.00.0130.00316.25
7.3.330.0030.00616.45
7.3.320.0050.00013.43
7.3.310.0030.00316.30
7.3.300.0030.00316.29
7.3.290.0070.00916.39
7.3.280.0030.01016.45
7.3.260.0140.00716.71
7.3.230.0120.00616.54
7.3.210.0130.00716.53
7.3.200.0030.01816.66
7.3.190.0170.00016.52
7.3.180.0170.00016.45
7.3.170.0100.00716.67
7.3.160.0120.01116.49
7.3.150.0070.01016.57
7.3.140.0070.01016.48
7.3.130.0070.01016.73
7.3.120.0070.01016.66
7.3.110.0040.01216.78
7.3.100.0100.00716.79
7.3.90.0100.00716.75
7.3.80.0070.01016.45
7.3.70.0090.00816.59
7.3.60.0100.00716.59
7.3.50.0070.01016.67
7.3.40.0110.00616.52
7.3.30.0030.01316.60
7.3.20.0070.01116.63
7.3.10.0110.00716.58
7.3.00.0140.00716.57
7.2.330.0030.01317.01
7.2.320.0120.00916.77
7.2.310.0090.00917.00
7.2.300.0120.00616.96
7.2.290.0090.01517.02
7.2.280.0090.01017.05
7.2.270.0100.01016.66
7.2.260.0070.01117.13
7.2.250.0070.01016.66
7.2.240.0060.01116.78
7.2.230.0150.00316.99
7.2.220.0070.01016.81
7.2.210.0060.01216.99
7.2.200.0060.01216.75
7.2.190.0070.01016.89
7.2.180.0060.01016.89
7.2.170.0000.01716.85
7.2.160.0180.00016.95
7.2.150.0160.00316.89
7.2.140.0070.01116.93
7.2.130.0120.00617.02
7.2.120.0130.00416.87
7.2.110.0150.00316.70
7.2.100.0130.00316.95
7.2.90.0130.00316.83
7.2.80.0150.00316.88
7.2.70.0120.00616.80
7.2.60.0080.01116.83
7.2.50.0060.01216.81
7.2.40.0140.00416.84
7.2.30.0040.01316.91
7.2.20.0110.00716.92
7.2.10.0000.01916.78
7.2.00.0150.00316.73

preferences:
44.1 ms | 403 KiB | 5 Q