3v4l.org

run code in 300+ PHP versions simultaneously
<?php \date_default_timezone_set('UTC'); $dates = ['2019-01-18', '2018-12-20', '2019-01-01', null]; echo 'Current Date: ' . date('Y-m-d') . \PHP_EOL; foreach ($dates as $iDate) { $_GET['importDate'] = $iDate; echo 'Import Date of: "' . $iDate . '"' . \PHP_EOL . \PHP_EOL; if (!$start = \date_create(!empty($_GET['importDate']) ? $_GET['importDate'] : 'yesterday')) { die('Invalid Date Supplied'); } //start at the first day of the month $start->modify('first day of this month')->setTime(0,0,0); //validate the current month to prevent future dates if ($start->format('Y-m') === date('Y-m')) { $end = \date_create('yesterday')->setTime(23,59,59); if ($end < $start) { //yesterday was last month $end = clone $start; } } else { $end = clone $start; $end->modify('last day of this month'); } //end at midnight $end->setTime(23,59,59); $importDates = new \DatePeriod($start, new \DateInterval('P1D'), $end); foreach ($importDates as $date) { $dateImport = $date->format('Y-m-d'); echo $dateImport . \PHP_EOL; //... } echo '------' . \PHP_EOL; }

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.4.130.0110.01117.80
8.4.120.0120.01020.88
8.4.110.0040.00718.78
8.4.100.0130.00817.69
8.4.90.0080.00220.61
8.4.80.0070.00318.95
8.4.70.0110.00918.86
8.4.60.0060.00218.73
8.4.50.0130.00518.79
8.4.40.0130.00619.29
8.4.30.0170.00317.73
8.4.20.0030.01720.42
8.4.10.0070.00317.77
8.3.260.0050.00416.81
8.3.250.0110.00818.76
8.3.240.0120.00816.63
8.3.230.0130.00616.65
8.3.220.0120.00719.18
8.3.210.0020.00716.55
8.3.200.0020.00816.59
8.3.190.0060.00217.22
8.3.180.0120.00919.10
8.3.170.0150.00317.02
8.3.160.0140.00717.14
8.3.150.0110.00717.01
8.3.140.0090.00019.21
8.3.130.0000.00818.49
8.3.120.0070.01018.82
8.3.110.0100.00020.94
8.3.100.0130.00724.06
8.3.90.0090.00026.77
8.3.80.0030.00616.58
8.3.70.0100.00616.75
8.3.60.0150.00616.88
8.3.50.0100.00718.43
8.3.40.0100.00619.12
8.3.30.0030.01218.79
8.3.20.0040.00420.52
8.3.10.0060.00321.86
8.3.00.0090.00023.65
8.2.290.0100.01016.81
8.2.280.0120.00418.88
8.2.270.0000.01516.91
8.2.260.0000.00918.31
8.2.250.0080.00016.71
8.2.240.0100.00716.96
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0060.00626.77
8.2.200.0100.00017.00
8.2.190.0080.00816.63
8.2.180.0120.00325.92
8.2.170.0000.01522.96
8.2.160.0060.01020.35
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00020.61
8.2.120.0040.00426.35
8.2.110.0080.00822.25
8.2.100.0090.00317.97
8.2.90.0000.00918.00
8.2.80.0030.00518.99
8.2.70.0030.00617.75
8.2.60.0060.00317.75
8.2.50.0040.00417.75
8.2.40.0000.00819.91
8.2.30.0000.00819.35
8.2.20.0000.00718.19
8.2.10.0030.00519.28
8.2.00.0030.00718.32
8.1.330.0100.00816.33
8.1.320.0110.00818.25
8.1.310.0110.00416.69
8.1.300.0090.00018.54
8.1.290.0060.00330.84
8.1.280.0160.00625.92
8.1.270.0110.00819.01
8.1.260.0030.00726.35
8.1.250.0090.00028.09
8.1.240.0030.00620.53
8.1.230.0060.00617.83
8.1.220.0040.00417.78
8.1.210.0090.00018.77
8.1.200.0070.00417.48
8.1.190.0070.00417.36
8.1.180.0040.00418.10
8.1.170.0000.00917.62
8.1.160.0050.00219.03
8.1.150.0000.00718.98
8.1.140.0000.00818.98
8.1.130.0070.00320.10
8.1.120.0050.00317.64
8.1.110.0040.00417.66
8.1.100.0040.00417.67
8.1.90.0040.00417.56
8.1.80.0080.00017.62
8.1.70.0000.00717.61
8.1.60.0000.00817.59
8.1.50.0000.00917.69
8.1.40.0050.00317.66
8.1.30.0050.00317.78
8.1.20.0040.00717.84
8.1.10.0000.00917.73
8.1.00.0040.00417.56
8.0.300.0000.00818.77
8.0.290.0040.00717.00
8.0.280.0040.00418.53
8.0.270.0040.00417.39
8.0.260.0070.00020.34
8.0.250.0050.00317.12
8.0.240.0030.00317.17
8.0.230.0000.00817.09
8.0.220.0070.00016.99
8.0.210.0070.00017.10
8.0.200.0040.00417.15
8.0.190.0000.00817.20
8.0.180.0000.00817.08
8.0.170.0080.00017.12
8.0.160.0000.00817.12
8.0.150.0040.00417.08
8.0.140.0030.00617.01
8.0.130.0030.00313.54
8.0.120.0000.00917.08
8.0.110.0000.00817.04
8.0.100.0080.00016.88
8.0.90.0000.00817.09
8.0.80.0110.00517.06
8.0.70.0040.00417.14
8.0.60.0000.00716.95
8.0.50.0050.00317.21
8.0.30.0110.01217.21
8.0.20.0100.01017.40
8.0.10.0000.00817.11
8.0.00.0110.00916.93
7.4.330.0000.00515.55
7.4.320.0000.00716.65
7.4.300.0000.00716.66
7.4.290.0000.00716.60
7.4.280.0040.00416.65
7.4.270.0070.00016.73
7.4.260.0080.00016.73
7.4.250.0000.00716.73
7.4.240.0000.00816.66
7.4.230.0040.00416.82
7.4.220.0000.00816.74
7.4.210.0060.01016.71
7.4.200.0040.00416.67
7.4.160.0070.01216.79
7.4.140.0120.01217.86
7.4.130.0200.00716.82
7.4.120.0150.01116.57
7.4.110.0110.00716.45
7.4.100.0100.01316.67
7.4.90.0140.00616.80
7.4.80.0170.00019.39
7.4.70.0060.01016.61
7.4.60.0110.01116.59
7.4.50.0120.00316.65
7.4.40.0090.00916.39
7.4.00.0070.01015.04
7.3.330.0050.00013.38
7.3.320.0000.00613.37
7.3.310.0030.00316.36
7.3.300.0040.00416.59
7.3.290.0070.00016.40
7.3.280.0140.00916.46
7.3.260.0060.01316.61
7.3.240.0090.01216.58
7.3.230.0120.00816.48
7.3.210.0070.01116.56
7.3.200.0160.00316.68
7.3.190.0090.00916.66
7.3.180.0120.00416.66
7.3.170.0130.00616.80
7.3.160.0130.01016.69
7.3.10.0540.00714.88
7.3.00.0460.00915.02
7.2.330.0120.00916.76
7.2.320.0040.01916.95
7.2.310.0060.01316.74
7.2.300.0110.01116.76
7.2.290.0090.00916.91
7.2.130.0540.00915.23
7.2.120.0650.01615.21
7.2.110.0590.00315.37
7.2.100.0560.00715.18
7.2.90.0610.00615.21
7.2.80.0590.01115.10
7.2.70.0640.00615.24
7.2.60.0870.00315.23
7.2.50.1080.00715.19
7.2.40.0720.01115.10
7.2.30.0650.00014.95
7.2.20.0640.00415.39
7.2.10.0690.00315.33
7.2.00.0700.00315.33
7.1.250.0510.00314.16

preferences:
119.47 ms | 403 KiB | 5 Q