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 = []; 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.76
8.4.120.0120.00820.53
8.4.110.0040.00718.89
8.4.100.0120.00818.85
8.4.90.0130.00718.78
8.4.80.0100.01017.73
8.4.70.0060.00317.73
8.4.60.0110.00918.69
8.4.50.0140.00620.30
8.4.40.0090.00917.67
8.4.30.0030.00620.53
8.4.20.0090.00020.52
8.4.10.0100.01017.75
8.3.260.0120.00616.69
8.3.250.0100.00918.70
8.3.240.0130.00716.66
8.3.230.0090.01016.54
8.3.220.0120.00617.43
8.3.210.0100.00516.68
8.3.200.0050.00516.64
8.3.190.0100.00917.29
8.3.180.0150.00518.61
8.3.170.0090.00917.42
8.3.160.0070.01116.38
8.3.150.0080.00419.04
8.3.140.0030.00617.16
8.3.130.0170.00318.13
8.3.120.0080.00421.01
8.3.110.0050.00320.94
8.3.100.0100.00024.06
8.3.90.0040.00426.77
8.3.80.0030.00716.75
8.3.70.0040.01116.75
8.3.60.0070.01418.56
8.3.50.0140.00718.48
8.3.40.0130.00720.85
8.3.30.0130.00318.55
8.3.20.0030.00524.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0120.00720.68
8.2.280.0040.00919.41
8.2.270.0080.01117.26
8.2.260.0090.00616.76
8.2.250.0040.00416.60
8.2.240.0090.00017.13
8.2.230.0100.01022.58
8.2.220.0080.00037.54
8.2.210.0070.00026.77
8.2.200.0030.00616.88
8.2.190.0120.00316.58
8.2.180.0090.00925.92
8.2.170.0110.00418.91
8.2.160.0090.00622.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0050.00522.25
8.2.100.0090.00317.91
8.2.90.0000.00819.34
8.2.80.0080.00017.97
8.2.70.0000.00817.75
8.2.60.0000.00817.63
8.2.50.0040.00417.75
8.2.40.0030.00619.93
8.2.30.0040.00418.27
8.2.20.0070.00018.02
8.2.10.0050.00219.45
8.2.00.0040.00419.38
8.1.330.0140.00921.73
8.1.320.0130.00716.01
8.1.310.0030.00616.69
8.1.300.0000.00816.23
8.1.290.0070.00318.88
8.1.280.0140.00025.92
8.1.270.0030.00523.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.59
8.1.230.0040.00722.69
8.1.220.0000.01017.74
8.1.210.0000.00818.98
8.1.200.0030.00617.23
8.1.190.0040.00417.43
8.1.180.0000.00818.10
8.1.170.0080.00018.51
8.1.160.0000.00718.92
8.1.150.0050.00318.60
8.1.140.0040.00417.40
8.1.130.0030.00518.82
8.1.120.0000.00817.49
8.1.110.0000.00817.44
8.1.100.0040.00417.46
8.1.90.0040.00417.49
8.1.80.0040.00417.50
8.1.70.0030.00317.35
8.1.60.0050.00317.49
8.1.50.0040.00417.54
8.1.40.0040.00417.59
8.1.30.0000.00817.55
8.1.20.0040.00417.62
8.1.10.0100.00017.47
8.1.00.0030.00617.46
8.0.300.0000.00819.88
8.0.290.0070.00316.75
8.0.280.0030.00618.47
8.0.270.0040.00417.95
8.0.260.0000.00618.38
8.0.250.0040.00416.88
8.0.240.0040.00417.02
8.0.230.0060.00316.84
8.0.220.0000.01016.93
8.0.210.0000.00816.91
8.0.200.0050.00317.00
8.0.190.0080.00016.93
8.0.180.0070.00016.98
8.0.170.0060.00316.95
8.0.160.0030.00616.99
8.0.150.0040.00416.86
8.0.140.0000.00716.78
8.0.130.0060.00013.43
8.0.120.0000.00816.88
8.0.110.0050.00216.91
8.0.100.0040.00416.98
8.0.90.0030.00316.81
8.0.80.0030.00516.95
8.0.70.0000.00716.80
8.0.60.0000.00716.80
8.0.50.0000.00916.97
8.0.30.0050.00516.92
8.0.20.0060.00316.98
8.0.10.0050.00316.98
8.0.00.0040.00416.92
7.4.330.0020.00215.55
7.4.320.0000.00616.64
7.4.300.0070.00016.43
7.4.290.0020.00516.58
7.4.280.0040.00416.53
7.4.270.0000.00816.59
7.4.260.0000.00513.31
7.4.250.0030.00616.35
7.4.240.0020.00516.48
7.4.230.0080.00016.41
7.4.220.0040.00416.60
7.4.210.0020.00516.62
7.4.200.0030.00616.34
7.4.190.0000.00716.48
7.4.180.0000.00816.48
7.4.160.0070.00016.49
7.4.150.0070.00016.58
7.4.140.0030.00516.45
7.4.130.0040.00416.46
7.4.120.0070.00016.33
7.4.110.0000.00816.52
7.4.100.0040.00416.63
7.4.90.0000.00716.66
7.4.80.0030.00516.58
7.4.70.0000.00616.39
7.4.60.0000.00816.55
7.4.50.0030.00516.59
7.4.40.0000.00816.32
7.4.30.0000.00816.51
7.4.20.0000.00716.63
7.4.10.0000.00716.23
7.4.00.0080.00016.45
7.3.330.0000.00716.28
7.3.320.0030.00313.36
7.3.310.0030.00316.44
7.3.300.0000.00716.31
7.3.290.0000.00716.28
7.3.280.0060.00016.27
7.3.270.0030.00616.23
7.3.260.0000.00816.45
7.3.250.0030.00616.41
7.3.240.0030.00516.25
7.3.230.0050.00216.35
7.3.220.0000.00916.20
7.3.210.0030.00316.34
7.3.200.0000.00716.38
7.3.190.0000.00716.25
7.3.180.0040.00416.20
7.3.170.0040.00416.34
7.3.160.0070.00016.25
7.3.150.0000.00816.28
7.3.140.0030.00616.28
7.3.130.0000.00816.21
7.3.120.0000.00716.23
7.3.110.0050.00316.28
7.3.100.0040.00416.14
7.3.90.0000.00816.54
7.3.80.0040.00416.33
7.3.70.0030.00316.43
7.3.60.0000.00716.38
7.3.50.0050.00216.52
7.3.40.0030.00316.38
7.3.30.0040.00416.34
7.3.20.0050.00316.50
7.3.10.0070.00016.54
7.3.00.0080.00016.46

preferences:
27 ms | 403 KiB | 5 Q