3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFutureWeekday( string $startDate, int $numberOfDays, array $holidays = [] ): string { $dt = new DateTime($startDate); for ($i = 0; $i < $numberOfDays; ++$i) { do { $date = $dt->modify('+1 weekday')->format("Y-m-d"); echo $date . "\n"; } while (in_array($date, $holidays)); } echo "---\n"; return $date ?? $startDate; } echo getFutureWeekday('2022-03-30', 4, ['2022-04-05']);

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.0120.00316.32
8.3.50.0100.00720.16
8.3.40.0130.00722.16
8.3.30.0160.00019.13
8.3.20.0050.00324.18
8.3.10.0090.00024.66
8.3.00.0040.00426.16
8.2.180.0100.01025.92
8.2.170.0060.01219.07
8.2.160.0170.00022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0110.00822.14
8.2.100.0040.00818.16
8.2.90.0030.00519.34
8.2.80.0000.00817.97
8.2.70.0050.00317.88
8.2.60.0060.00318.18
8.2.50.0080.00018.07
8.2.40.0000.00820.07
8.2.30.0000.00718.23
8.2.20.0060.00320.52
8.2.10.0070.00018.12
8.2.00.0070.00419.08
8.1.280.0070.00725.92
8.1.270.0060.00323.99
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0000.00923.92
8.1.230.0070.00417.82
8.1.220.0110.00618.88
8.1.210.0000.00818.77
8.1.200.0040.00417.60
8.1.190.0060.00617.47
8.1.180.0040.00418.10
8.1.170.0040.00418.60
8.1.160.0030.00618.92
8.1.150.0040.00418.86
8.1.140.0040.00417.70
8.1.130.0050.00419.13
8.1.120.0060.00418.52
8.1.110.0080.00217.72
8.1.100.0060.00417.71
8.1.90.0090.00217.71
8.1.80.0070.00617.68
8.1.70.0060.00417.67
8.1.60.0040.00617.76
8.1.50.0030.00717.75
8.1.40.0150.00417.71
8.1.30.0140.00317.78
8.1.20.0150.00317.72
8.1.10.0120.00617.57
8.1.00.0170.00517.67
8.0.300.0060.00318.77
8.0.290.0040.00417.00
8.0.280.0040.00617.50
8.0.270.0030.00318.31
8.0.260.0040.00518.02
8.0.250.0060.00517.29
8.0.240.0070.00417.31
8.0.230.0080.00417.29
8.0.220.0080.00317.24
8.0.210.0080.00417.25
8.0.200.0100.00317.29
8.0.190.0030.00917.30
8.0.180.0080.00317.27
8.0.170.0120.00317.26
8.0.160.0150.00217.18
8.0.150.0120.00617.16
8.0.140.0180.00017.22
8.0.130.0180.00017.21
8.0.120.0150.00317.26
8.0.110.0130.00617.25
8.0.100.0160.00117.26
8.0.90.0110.00617.20
8.0.80.0150.00317.24
8.0.70.0170.00317.24
8.0.60.0160.00217.21
8.0.50.0150.00417.28
8.0.30.0150.00717.26
8.0.20.0130.00517.30
8.0.10.0120.00517.26
7.4.330.0090.00016.51
7.4.320.0080.00317.10
7.4.300.0090.00217.09
7.4.290.0060.00517.10
7.4.280.0130.00717.07
7.4.270.0090.01117.08
7.4.260.0150.00417.08
7.4.250.0160.00317.05
7.4.240.0160.00317.06
7.4.230.0180.00217.00
7.4.220.0130.00317.06
7.4.210.0130.00517.08
7.4.200.0150.00417.09
7.4.190.0150.00417.10
7.4.180.0160.00317.14
7.4.160.0100.00717.10
7.4.150.0110.00617.07
7.4.140.0170.00116.98
7.4.130.0140.00317.00
7.4.120.0160.00017.09
7.4.110.0120.00517.04
7.4.100.0130.00417.01
7.4.90.0100.00617.05
7.4.80.0140.00417.00
7.4.70.0090.00717.02
7.4.60.0100.00717.08
7.4.50.0130.00316.99
7.4.40.0110.00516.97
7.4.30.0130.00317.04
7.4.20.0120.00417.03
7.4.10.0120.00417.06
7.4.00.0150.00217.07

preferences:
33 ms | 400 KiB | 5 Q