3v4l.org

run code in 300+ PHP versions simultaneously
<?php $order_date = '2020-07-09 10:23:00'; // if no argument the, use the current time function getPossibleShippingDates($order_date = 'now', $num_day = 3) { $dates = []; $dt = new DateTime($order_date); if ($dt->format('H') >= 10) { // if ordered on or after 10, move to next day $dt->modify('+1 day'); } if (in_array($dt->format('N'), [6, 7])) { // if ordered weekend, adjust to start monday $dt->modify('next monday'); } $i = 1; while ($i <= $num_day) { if (!in_array($dt->format('N'), [6, 7])) { $dates[$i++] = $dt->format('Y-m-d'); } $dt->modify('+1 day'); } return $dates; } $dates = getPossibleShippingDates($order_date); print_r($dates);

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.5.00.0130.01120.36
8.4.150.0020.00114.05
8.4.140.0100.01117.89
8.4.130.0110.01018.13
8.4.120.0150.00620.51
8.4.110.0100.00918.73
8.4.100.0130.00617.95
8.4.90.0130.00720.68
8.4.80.0080.00519.08
8.4.70.0050.00319.16
8.4.60.0120.00918.75
8.4.50.0100.00922.37
8.4.40.0130.00617.62
8.4.30.0060.01320.39
8.4.20.0130.00618.79
8.4.10.0040.00420.66
8.3.280.0100.00618.72
8.3.270.0120.00816.59
8.3.260.0120.00716.55
8.3.250.0110.00718.81
8.3.240.0060.00916.97
8.3.230.0100.00716.76
8.3.220.0110.00618.80
8.3.210.0120.00618.43
8.3.200.0030.00616.54
8.3.190.0110.00717.20
8.3.180.0100.00418.75
8.3.170.0130.00316.76
8.3.160.0060.01317.00
8.3.150.0060.01317.43
8.3.140.0070.01120.66
8.3.130.0060.00318.66
8.3.120.0060.00320.41
8.3.110.0070.00420.94
8.3.100.0100.00724.06
8.3.90.0060.00326.77
8.3.80.0050.00519.36
8.3.70.0090.00616.63
8.3.60.0090.01218.29
8.3.50.0090.00823.72
8.3.40.0070.01118.86
8.3.30.0140.00419.04
8.3.20.0020.00524.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.290.0120.00616.70
8.2.280.0060.00318.42
8.2.270.0040.01120.97
8.2.260.0120.00617.04
8.2.250.0040.00416.85
8.2.240.0050.00317.34
8.2.230.0050.00322.58
8.2.220.0100.00637.54
8.2.210.0110.00726.77
8.2.200.0060.00318.88
8.2.190.0190.00416.59
8.2.180.0100.01025.92
8.2.170.0130.00719.06
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00019.20
8.2.110.0050.00520.70
8.2.100.0090.00318.03
8.2.90.0040.00417.88
8.2.80.0090.00018.89
8.2.70.0060.00317.63
8.2.60.0040.00418.05
8.2.50.0080.00018.07
8.2.40.0040.00419.91
8.2.30.0040.00418.37
8.2.20.0060.00518.08
8.2.10.0070.00518.72
8.2.00.0050.00618.62
8.1.330.0120.00816.46
8.1.320.0120.00717.98
8.1.310.0000.00917.01
8.1.300.0090.00918.10
8.1.290.0050.00530.84
8.1.280.0130.00325.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0020.00528.09
8.1.240.0070.00423.68
8.1.230.0040.00820.96
8.1.220.0080.00017.77
8.1.210.0030.00518.77
8.1.200.0060.00517.60
8.1.190.0050.00317.38
8.1.180.0000.00918.10
8.1.170.0040.00418.82
8.1.160.0000.00719.08
8.1.150.0090.00318.25
8.1.140.0040.00818.25
8.1.130.0080.00517.70
8.1.120.0080.00618.13
8.1.110.0070.00618.19
8.1.100.0100.00418.15
8.1.90.0050.00618.03
8.1.80.0080.00618.03
8.1.70.0080.00517.91
8.1.60.0100.00517.99
8.1.50.0100.00617.89
8.1.40.0110.00317.91
8.1.30.0130.00418.07
8.1.20.0140.00218.07
8.1.10.0070.00817.93
8.1.00.0100.00617.91
8.0.300.0070.00018.77
8.0.290.0040.00417.00
8.0.280.0030.00318.59
8.0.270.0080.00317.66
8.0.260.0040.00617.06
8.0.250.0040.00617.52
8.0.240.0060.00617.59
8.0.230.0040.00817.54
8.0.220.0070.00417.39
8.0.210.0110.00217.42
8.0.200.0090.00417.34
8.0.190.0050.00717.35
8.0.180.0090.00417.40
8.0.170.0110.00217.40
8.0.160.0070.00617.33
8.0.150.0090.00617.30
8.0.140.0070.00617.36
8.0.130.0100.00416.71
8.0.120.0100.00417.29
8.0.110.0090.00417.27
8.0.100.0100.00417.29
8.0.90.0110.00317.32
8.0.80.0110.00517.31
8.0.70.0110.00417.25
8.0.60.0070.00817.33
8.0.50.0070.00717.26
8.0.30.0100.00517.32
8.0.20.0110.00717.37
8.0.10.0080.00717.46
8.0.00.0060.00717.41
7.4.330.0080.00315.55
7.4.320.0110.00317.12
7.4.300.0090.00416.92
7.4.290.0060.00716.93
7.4.280.0110.00416.97
7.4.270.0120.00316.99
7.4.260.0090.00716.41
7.4.250.0090.00716.91
7.4.240.0120.00316.96
7.4.230.0080.00616.85
7.4.220.0080.00416.96
7.4.210.0080.00716.88
7.4.200.0100.00316.91
7.4.190.0110.00317.00
7.4.180.0100.00616.98
7.4.160.0110.00516.97
7.4.150.0100.00616.93
7.4.140.0110.00416.82
7.4.130.0090.00716.80
7.4.120.0080.00816.74
7.4.110.0110.00616.84
7.4.100.0080.00916.81
7.4.90.0120.00516.85
7.4.80.0130.00516.78
7.4.70.0140.00616.71
7.4.60.0110.00916.80
7.4.50.0140.00616.70
7.4.40.0110.00716.78
7.4.30.0110.00816.79
7.4.20.0110.00816.80
7.4.10.0130.00616.83
7.4.00.0090.00916.82
7.3.330.0100.00416.75
7.3.320.0090.00516.27
7.3.310.0100.00416.79
7.3.300.0090.00516.75
7.3.290.0100.00516.71
7.3.280.0110.00516.73
7.3.270.0120.00416.78
7.3.260.0090.00716.84
7.3.250.0090.00616.83
7.3.240.0100.00716.78
7.3.230.0100.00716.67
7.3.220.0100.00716.71
7.3.210.0100.00716.73
7.3.200.0130.00716.69
7.3.190.0140.00616.68
7.3.180.0130.00716.73
7.3.170.0110.00716.66
7.3.160.0110.00716.68
7.3.150.0130.00716.70
7.3.140.0140.00816.74
7.3.130.0120.00916.75
7.3.120.0130.00516.70
7.3.110.0140.00616.67
7.3.100.0130.00616.70
7.3.90.0120.00816.77
7.3.80.0120.00716.67
7.3.70.0120.00616.71
7.3.60.0140.00516.77
7.3.50.0120.00716.74
7.3.40.0110.00816.76
7.3.30.0100.00916.71
7.3.20.0150.00717.99
7.3.10.0140.00817.86
7.3.00.0140.00617.95
7.2.340.0130.00616.92
7.2.330.0130.00616.92
7.2.320.0150.00516.90
7.2.310.0140.00616.89
7.2.300.0140.00716.85
7.2.290.0130.00716.90
7.2.280.0130.00816.87
7.2.270.0140.00716.89
7.2.260.0140.00816.89
7.2.250.0150.00616.88
7.2.240.0150.00616.89
7.2.230.0120.00816.88
7.2.220.0140.00616.87
7.2.210.0130.00716.87
7.2.200.0160.00516.89
7.2.190.0140.00716.84
7.2.180.0110.00816.95
7.2.170.0130.00716.93
7.2.160.0150.00616.89
7.2.150.0120.01018.14
7.2.140.0140.00718.13
7.2.130.0160.00618.27
7.2.120.0170.00618.17
7.2.110.0180.00618.23
7.2.100.0160.00618.14
7.2.90.0160.00718.11
7.2.80.0140.00818.12
7.2.70.0130.00818.13
7.2.60.0130.00818.20
7.2.50.0130.00818.11
7.2.40.0140.00818.20
7.2.30.0150.00618.17
7.2.20.0170.00518.22
7.2.10.0160.00718.19
7.2.00.0120.00818.25

preferences:
144.94 ms | 403 KiB | 5 Q