3v4l.org

run code in 300+ PHP versions simultaneously
<?php $openTimeslots = ['02-09-2021' => [ '8:00-10:00', '16:00-19:00'], '03-09-2021' => [ '7:00-10:00', '16:15-19:00', '14:00-16:00', '13:00-14:15'], '04-09-2021' => [ '7:15-10:00', '15:15-18:15', '18:30-18:45']]; function intersectTimeslots($timeslots1, $timeslots2) { $newTimeslots = []; if (count($timeslots1) > 0 && count($timeslots2) > 0) { foreach ($timeslots1 as $timeslot1) { [$start1, $finish1] = sscanf(str_replace(':', '', $timeslot1), "%d-%d"); foreach ($timeslots2 as $timeslot2) { [$start2, $finish2] = sscanf(str_replace(':', '', $timeslot2), "%d-%d"); $newStart = max($start1, $start2); $newFinish = min($finish1, $finish2); if ($newStart < $newFinish) { $newTimeslots[] = substr_replace($newStart, ':', -2, 0) . '-' . substr_replace($newFinish, ':', -2, 0); } } } } return $newTimeslots; } $commonTimeslots = array_shift($openTimeslots); foreach ($openTimeslots as $timeslots) { $commonTimeslots = intersectTimeslots($commonTimeslots, $timeslots); } var_export($commonTimeslots);

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.00917.79
8.4.120.0030.00820.59
8.4.110.0100.01122.33
8.4.100.0110.00917.74
8.4.90.0100.01218.65
8.4.80.0120.00917.68
8.4.70.0140.00817.92
8.4.60.0090.01019.18
8.4.50.0090.00717.70
8.4.40.0170.00317.84
8.4.30.0070.01420.71
8.4.20.0060.01324.18
8.4.10.0060.00317.57
8.3.260.0120.00716.71
8.3.250.0140.00619.13
8.3.240.0050.00316.64
8.3.230.0050.00316.61
8.3.220.0030.00417.04
8.3.210.0110.00816.81
8.3.200.0120.00716.82
8.3.190.0080.01117.34
8.3.180.0070.00416.60
8.3.170.0110.00718.95
8.3.160.0120.00618.38
8.3.150.0100.01020.53
8.3.140.0080.00018.95
8.3.130.0070.00716.67
8.3.120.0000.00918.89
8.3.110.0040.00420.94
8.3.100.0050.00516.49
8.3.90.0050.00326.77
8.3.80.0040.00416.88
8.3.70.0140.00416.58
8.3.60.0140.00416.37
8.3.50.0060.01218.33
8.3.40.0120.00420.80
8.3.30.0040.01118.61
8.3.20.0000.00724.18
8.3.10.0050.00524.66
8.3.00.0070.00026.16
8.2.290.0090.00920.35
8.2.280.0090.01018.33
8.2.270.0130.00617.28
8.2.260.0070.00717.40
8.2.250.0060.00316.85
8.2.240.0030.00618.77
8.2.230.0060.00322.58
8.2.220.0030.00624.06
8.2.210.0000.00826.77
8.2.200.0030.00616.88
8.2.190.0070.01316.58
8.2.180.0070.01025.92
8.2.170.0090.01219.09
8.2.160.0100.00322.96
8.2.150.0060.00325.66
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0080.00026.16
8.2.110.0060.00322.24
8.2.100.0120.00017.91
8.2.90.0000.00817.63
8.2.80.0040.00417.97
8.2.70.0030.00517.75
8.2.60.0030.00617.50
8.2.50.0050.00317.98
8.2.40.0030.00617.88
8.2.30.0050.00317.83
8.2.20.0000.00718.05
8.2.10.0040.00419.23
8.2.00.0040.00419.40
8.1.330.0120.00821.94
8.1.320.0040.00616.20
8.1.310.0150.00416.61
8.1.300.0040.01518.16
8.1.290.0090.00030.84
8.1.280.0060.01025.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0040.00423.88
8.1.230.0040.00719.15
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.01017.23
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0000.00717.62
8.1.160.0000.00719.04
8.1.150.0060.00318.78
8.1.140.0020.00517.53
8.1.130.0000.00718.92
8.1.120.0030.00517.52
8.1.110.0000.00817.47
8.1.100.0000.00717.50
8.1.90.0000.00717.52
8.1.80.0030.00517.40
8.1.70.0040.00417.49
8.1.60.0030.00517.62
8.1.50.0000.01017.51
8.1.40.0080.00017.57
8.1.30.0000.00917.73
8.1.20.0030.00517.59
8.1.10.0000.00717.59
8.1.00.0000.00917.54
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0030.00318.48
8.0.270.0030.00316.77
8.0.260.0040.00418.44
8.0.250.0000.00716.91
8.0.240.0050.00317.01
8.0.230.0040.00417.05
8.0.220.0100.00016.96
8.0.210.0000.00716.88
8.0.200.0060.00316.95
8.0.190.0000.00816.92
8.0.180.0040.00416.95
8.0.170.0030.00616.91
8.0.160.0080.00016.78
8.0.150.0040.00416.88
8.0.140.0050.00616.82
8.0.130.0050.00013.33
8.0.120.0060.00316.88
8.0.110.0000.00816.83
8.0.100.0050.00216.93
8.0.90.0050.00216.86
8.0.80.0040.00416.93
8.0.70.0000.00716.91
8.0.60.0000.00816.92
8.0.50.0020.00516.94
8.0.30.0040.00416.70
8.0.20.0070.00016.98
8.0.10.0070.00016.90
8.0.00.0040.00417.10
7.4.330.0000.00515.55
7.4.320.0000.00616.55
7.4.300.0000.00716.57
7.4.290.0000.00716.45
7.4.280.0040.00716.57
7.4.270.0000.00816.64
7.4.260.0030.00313.29
7.4.250.0060.00316.52
7.4.240.0050.00216.57
7.4.230.0030.00316.67
7.4.220.0030.00316.60
7.4.210.0070.00016.61
7.4.200.0030.00516.53
7.4.190.0050.00316.77
7.4.180.0000.00716.66
7.4.160.0080.00016.78
7.4.150.0070.00016.42
7.4.140.0070.00016.32
7.4.130.0040.00416.47
7.4.120.0030.00316.44
7.4.110.0080.00016.25
7.4.100.0080.00016.47
7.4.90.0000.00716.45
7.4.80.0040.00416.43
7.4.70.0030.00316.57
7.4.60.0030.00316.37
7.4.50.0030.00316.11
7.4.40.0030.00316.56
7.4.30.0090.00016.25
7.4.20.0030.00616.42
7.4.10.0080.00016.27
7.4.00.0050.00316.58
7.3.330.0000.00816.48
7.3.320.0030.00313.42
7.3.310.0070.00016.41
7.3.300.0050.00216.24
7.3.290.0030.00316.37
7.3.280.0000.00616.21
7.3.270.0000.00716.36
7.3.260.0030.00316.23
7.3.250.0030.00316.41
7.3.240.0030.00316.32
7.3.230.0030.00316.27
7.3.220.0030.00316.16
7.3.210.0000.00616.30
7.3.200.0000.00616.17
7.3.190.0070.00016.19
7.3.180.0030.00316.17
7.3.170.0000.00616.33
7.3.160.0030.00316.16
7.3.150.0060.00016.25
7.3.140.0000.00616.17
7.3.130.0000.00716.23
7.3.120.0040.00416.29
7.3.110.0040.00416.23
7.3.100.0030.00316.19
7.3.90.0000.00616.51
7.3.80.0030.00316.29
7.3.70.0030.00316.29
7.3.60.0000.00616.33
7.3.50.0070.00016.47
7.3.40.0030.00316.47
7.3.30.0060.00016.35
7.3.20.0000.00718.27
7.3.10.0000.00718.18
7.3.00.0030.00318.20

preferences:
31.64 ms | 403 KiB | 5 Q