3v4l.org

run code in 300+ PHP versions simultaneously
<?php $staff = array(1,2,3,4,5); $start = array("11:05", "11:00", "19:00", "13:00", "19:00"); $end = array("20:00", "17:00", "03:00", "20:00", "03:05"); array_multisort($start, $end, $staff); $aloneStart = (strtotime($start[1]) - strtotime($start[0]))/60; // first and second items are the ones that may be working alone at start $aloneEnd = (strtotime($end[count($end)-1]) - strtotime($end[count($end)-2]))/60; // last and second to last are the ones that may be working alone at end if($aloneStart > 0){ $staffAloneStart = $staff[0]; //must be the first who worked alone echo "minutes alone at start: " . $aloneStart . " and it was " . $staffAloneStart . "\n"; } if($aloneEnd > 0){ $staffAloneEnd = $staff[count($end)-1]; // must be the last to end that worked alone echo "minutes alone at end: " . $aloneEnd . " and it was " . $staffAloneEnd . "\n"; } $aloneTime = intval($aloneStart)+intval($aloneEnd); echo "total time alone " . $aloneTime;

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.70.0000.01516.75
8.3.60.0090.00616.63
8.3.50.0090.00917.55
8.3.40.0110.01118.92
8.3.30.0040.01118.79
8.3.20.0030.00520.30
8.3.10.0030.00523.68
8.3.00.0030.00619.81
8.2.190.0110.00716.58
8.2.180.0040.01118.41
8.2.170.0110.00422.96
8.2.160.0110.00419.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00019.43
8.2.110.0100.00022.30
8.2.100.0080.00417.84
8.2.90.0080.00020.48
8.2.80.0000.00917.97
8.2.70.0050.00318.05
8.2.60.0000.00818.34
8.2.50.0070.00418.10
8.2.40.0050.00319.17
8.2.30.0000.00719.47
8.2.20.0030.00718.18
8.2.10.0030.00518.09
8.2.00.0000.00718.27
8.1.280.0040.01425.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00622.60
8.1.230.0070.00420.98
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0050.00317.47
8.1.190.0000.00817.48
8.1.180.0050.00518.10
8.1.170.0050.00318.59
8.1.160.0000.00718.98
8.1.150.0070.00018.86
8.1.140.0040.00419.59
8.1.130.0000.00717.61
8.1.120.0040.00317.61
8.1.110.0050.00317.62
8.1.100.0050.00517.63
8.1.90.0030.00617.64
8.1.80.0040.00317.64
8.1.70.0050.00217.65
8.1.60.0030.00617.65
8.1.50.0040.00417.64
8.1.40.0040.00417.61
8.1.30.0000.00817.84
8.1.20.0000.00817.70
8.1.10.0080.00017.67
8.1.00.0000.00817.58
8.0.300.0080.00019.93
8.0.290.0060.00316.88
8.0.280.0030.00318.44
8.0.270.0040.00417.02
8.0.260.0070.00016.92
8.0.250.0030.00317.04
8.0.240.0000.00717.04
8.0.230.0040.00417.23
8.0.220.0030.00317.10
8.0.210.0000.00716.96
8.0.200.0060.00317.18
8.0.190.0050.00317.06
8.0.180.0000.00817.10
8.0.170.0000.00717.01
8.0.160.0070.00017.06
8.0.150.0030.00316.89
8.0.140.0060.00317.09
8.0.130.0090.00013.41
8.0.120.0000.00817.03
8.0.110.0070.00017.09
8.0.100.0000.00716.91
8.0.90.0070.00017.02
8.0.80.0070.01017.12
8.0.70.0080.00016.98
8.0.60.0040.00416.96
8.0.50.0000.00716.91
8.0.30.0120.00617.23
8.0.20.0100.01017.40
8.0.10.0000.00817.25
8.0.00.0090.00916.86
7.4.330.0050.00015.55
7.4.320.0080.00016.66
7.4.300.0030.00316.77
7.4.290.0060.00316.70
7.4.280.0040.00416.62
7.4.270.0070.00016.68
7.4.260.0000.00716.71
7.4.250.0000.00816.59
7.4.240.0000.00716.77
7.4.230.0050.00316.45
7.4.220.0070.01016.55
7.4.210.0100.01016.66
7.4.200.0080.00016.49
7.4.160.0090.00716.71
7.4.150.0060.01217.40
7.4.140.0070.01317.86
7.4.130.0120.00616.67
7.4.120.0110.01016.67
7.4.110.0070.01016.53
7.4.100.0120.01216.50
7.4.90.0130.00616.71
7.4.80.0040.01319.39
7.4.70.0090.01216.81
7.4.60.0110.00616.67
7.4.50.0060.00616.62
7.4.40.0030.01416.80
7.4.30.0100.00716.68
7.4.10.0050.01315.88
7.4.00.0070.00815.44
7.3.330.0000.00613.35
7.3.320.0040.00413.29
7.3.310.0000.00716.47
7.3.300.0000.00716.45
7.3.290.0010.01316.39
7.3.280.0080.00916.43
7.3.270.0030.01517.40
7.3.260.0070.01016.62
7.3.250.0110.00816.50
7.3.240.0120.00616.48
7.3.230.0070.01016.62
7.3.210.0070.01016.61
7.3.200.0040.01216.45
7.3.190.0100.01316.52
7.3.180.0080.00816.79
7.3.170.0110.00816.57
7.3.160.0100.00716.56
7.3.130.0090.01115.76
7.3.120.0040.01215.65
7.3.110.0090.00915.38
7.3.100.0030.00915.40
7.3.90.0040.00715.38
7.3.80.0060.00815.52
7.3.70.0060.00815.38
7.3.60.0060.00915.38
7.3.50.0060.00515.35
7.3.40.0030.00815.36
7.3.30.0050.00915.31
7.3.20.0060.00617.30
7.3.10.0100.00517.29
7.3.00.0070.00917.32
7.2.330.0090.00916.70
7.2.320.0030.01316.89
7.2.310.0140.00316.50
7.2.300.0040.01216.93
7.2.290.0150.00916.58
7.2.260.0090.00916.06
7.2.250.0060.01215.78
7.2.240.0080.01015.63
7.2.230.0040.00915.79
7.2.220.0070.00715.78
7.2.210.0090.00915.96
7.2.200.0070.00815.66
7.2.190.0030.00815.61
7.2.180.0060.00615.59
7.2.170.0100.00515.73
7.2.160.0030.00715.92
7.2.150.0040.00917.82
7.2.140.0050.01017.70
7.2.130.0050.01017.75
7.2.120.0070.00817.81
7.2.110.0070.00717.71
7.2.100.0020.01217.89
7.2.90.0100.00217.80
7.2.80.0030.01417.82
7.2.70.0060.00817.79
7.2.60.0040.01017.56
7.2.50.0060.00817.81
7.2.40.0120.00317.75
7.2.30.0060.00817.92
7.2.20.0060.01017.84
7.2.10.0070.00417.73
7.2.00.0110.00517.72
7.1.330.0060.01016.50
7.1.320.0020.01016.51
7.1.310.0090.00516.38
7.1.300.0040.00816.40
7.1.290.0080.00816.28
7.1.280.0050.00816.27
7.1.270.0060.00716.33
7.1.260.0040.01016.37
7.1.250.0050.00916.60
7.1.240.0110.00316.61
7.1.230.0030.00916.56
7.1.220.0060.00716.77
7.1.210.0050.00716.66
7.1.200.0060.00916.42
7.1.190.0040.01216.68
7.1.180.0030.00816.71
7.1.170.0070.00816.80
7.1.160.0060.00616.78
7.1.150.0100.00516.81
7.1.140.0060.01116.53
7.1.130.0070.00616.59
7.1.120.0050.01316.72
7.1.110.0070.00816.77
7.1.100.0040.00916.70
7.1.90.0050.00716.77
7.1.80.0070.00516.64
7.1.70.0160.00916.36
7.1.60.0230.00422.22
7.1.50.0230.00622.17
7.1.40.0210.00722.09
7.1.30.0190.01022.09
7.1.20.0190.00922.21
7.1.10.0140.00816.13
7.1.00.0130.00716.07
7.0.330.0070.00716.33
7.0.320.0060.00716.31
7.0.310.0110.00416.33
7.0.300.0070.00516.33
7.0.290.0100.00316.19
7.0.280.0050.00616.33
7.0.270.0050.00916.25
7.0.260.0050.00816.39
7.0.250.0080.00416.31
7.0.240.0050.01016.40
7.0.230.0080.00316.33
7.0.220.0070.00716.12
7.0.210.0040.00716.40
7.0.200.0160.00715.85
7.0.190.0160.00615.95
7.0.180.0190.00415.67
7.0.170.0160.00615.84
7.0.160.0110.00915.79
7.0.150.0190.00615.74
7.0.140.0120.01115.79
7.0.130.0170.00715.79
7.0.120.0140.00915.76
7.0.110.0160.00715.80
7.0.100.0140.00915.79
7.0.90.0160.01015.75
7.0.80.0150.00715.80
7.0.70.0130.01015.70
7.0.60.0290.00415.67
7.0.50.0120.01015.76
7.0.40.0090.01114.51
7.0.30.0170.00714.42
7.0.20.0130.01014.39
7.0.10.0100.01214.46
7.0.00.0090.01114.46
5.6.400.0050.01115.33
5.6.390.0050.00715.49
5.6.380.0050.01015.46
5.6.370.0070.00915.18
5.6.360.0050.00715.34
5.6.350.0060.00815.13
5.6.340.0020.01115.35
5.6.330.0060.00815.42
5.6.320.0060.00515.17
5.6.310.0050.00815.43
5.6.300.0060.00815.34
5.6.290.0080.00515.35
5.6.280.0040.00715.14
5.6.270.0050.00815.28
5.6.260.0020.01415.42
5.6.250.0050.00915.19
5.6.240.0030.00915.19
5.6.230.0080.00715.13
5.6.220.0030.01115.18
5.6.210.0110.00215.27
5.6.200.0020.01415.33
5.6.190.0080.00915.30
5.6.180.0090.00315.36
5.6.170.0040.00915.26
5.6.160.0050.00915.04
5.6.150.0060.00815.39
5.6.140.0070.00715.44
5.6.130.0060.00615.24
5.6.120.0010.01115.22
5.6.110.0070.00715.48
5.6.100.0040.01115.44
5.6.90.0070.00715.22
5.6.80.0070.00515.37
5.6.70.0030.01215.22
5.6.60.0030.01115.16
5.6.50.0050.00815.12
5.6.40.0060.01015.19
5.6.30.0040.01215.15
5.6.20.0080.00915.18
5.6.10.0100.00815.16
5.6.00.0090.00815.22

preferences:
63.01 ms | 401 KiB | 5 Q