3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strToDuration($str) { sscanf($str, '%d:%d:%d', $hours, $minutes, $seconds); return $seconds + ($minutes * 60) + ($hours * 60 * 60); } function durationToStr($duration) { $hours = floor($duration / (60 * 60)); $seconds = $duration % (60 * 60); $minutes = floor($seconds / 60); $seconds %= 60; return sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); } $morning = '54:05:12'; $evening = '123:05:29'; echo durationToStr(strToDuration($morning) + strToDuration($evening));

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.0110.00318.56
8.3.50.0140.00821.33
8.3.40.0100.01018.78
8.3.30.0120.00319.17
8.3.20.0060.00620.29
8.3.10.0050.00222.04
8.3.00.0040.00422.45
8.2.180.0130.00916.63
8.2.170.0080.00522.96
8.2.160.0090.01219.33
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0040.00422.25
8.2.100.0040.00719.76
8.2.90.0000.00719.43
8.2.80.0000.00718.15
8.2.70.0030.00617.63
8.2.60.0030.00618.16
8.2.50.0060.00318.07
8.2.40.0040.00419.88
8.2.30.0030.00618.24
8.2.20.0000.00817.83
8.2.10.0030.00617.83
8.2.00.0080.00017.75
8.1.280.0140.00725.92
8.1.270.0060.00922.28
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00624.00
8.1.230.0040.00819.22
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0040.00417.51
8.1.180.0000.00818.82
8.1.170.0040.00418.66
8.1.160.0070.00022.19
8.1.150.0050.00318.63
8.1.140.0040.00417.45
8.1.130.0030.00317.84
8.1.120.0000.00717.45
8.1.110.0040.00417.43
8.1.100.0040.00417.34
8.1.90.0040.00317.41
8.1.80.0020.00517.52
8.1.70.0000.00717.34
8.1.60.0030.00617.52
8.1.50.0000.00717.47
8.1.40.0050.00317.62
8.1.30.0000.00717.66
8.1.20.0030.00617.70
8.1.10.0000.00717.61
8.1.00.0060.00317.39
8.0.300.0030.00318.77
8.0.290.0040.00417.16
8.0.280.0080.00018.47
8.0.270.0040.00417.23
8.0.260.0040.00417.00
8.0.250.0030.00517.07
8.0.240.0070.00017.05
8.0.230.0030.00317.02
8.0.220.0050.00216.95
8.0.210.0000.00716.90
8.0.200.0020.00517.07
8.0.190.0000.00717.14
8.0.180.0000.00716.95
8.0.170.0040.00417.03
8.0.160.0030.00517.00
8.0.150.0050.00216.93
8.0.140.0070.00016.98
8.0.130.0060.00013.40
8.0.120.0000.00716.96
8.0.110.0000.00817.02
8.0.100.0040.00416.95
8.0.90.0040.00416.96
8.0.80.0100.00716.95
8.0.70.0000.00717.07
8.0.60.0050.00317.00
8.0.50.0040.00416.85
8.0.30.0140.00517.22
8.0.20.0100.00817.40
8.0.10.0070.00017.11
8.0.00.0050.01216.93
7.4.330.0000.00715.00
7.4.320.0000.00616.51
7.4.300.0060.00016.55
7.4.290.0000.00716.61
7.4.280.0030.00316.52
7.4.270.0030.00316.59
7.4.260.0000.00616.56
7.4.250.0000.00816.52
7.4.240.0060.00216.58
7.4.230.0000.00716.73
7.4.220.0030.01516.60
7.4.210.0080.00916.59
7.4.200.0040.00416.75
7.4.190.0070.00016.46
7.4.160.0030.01216.47
7.4.150.0090.00917.40
7.4.140.0160.00517.86
7.4.130.0100.00816.60
7.4.120.0070.01016.55
7.4.110.0170.00016.52
7.4.100.0120.00616.46
7.4.90.0060.01216.56
7.4.80.0040.01519.39
7.4.70.0030.01316.54
7.4.60.0100.00716.36
7.4.50.0040.00416.50
7.4.40.0030.01022.77
7.4.30.0110.00516.72
7.4.00.0070.00714.90
7.3.330.0000.00513.16
7.3.320.0000.00613.25
7.3.310.0030.00316.27
7.3.300.0030.00316.38
7.3.290.0100.00416.39
7.3.280.0100.00816.44
7.3.270.0090.00917.40
7.3.260.0140.00316.43
7.3.250.0050.01416.55
7.3.240.0060.01116.46
7.3.230.0070.01016.48
7.3.210.0070.01016.72
7.3.200.0100.01019.39
7.3.190.0110.01116.74
7.3.180.0060.01016.64
7.3.170.0120.00616.52
7.3.160.0130.00316.28
7.3.120.0070.00714.86
7.3.10.0090.00316.74
7.3.00.0090.00016.40
7.2.330.0180.00316.82
7.2.320.0060.01316.71
7.2.310.0160.00716.88
7.2.300.0100.00616.75
7.2.290.0140.00316.44
7.2.130.0040.00816.64
7.2.120.0070.00316.93
7.2.110.0030.00917.02
7.2.100.0030.00816.82
7.2.90.0100.00316.66
7.2.80.0060.00916.65
7.2.70.0030.01017.08
7.2.60.0030.00916.97
7.2.50.0000.01116.85
7.2.40.0100.00316.60
7.2.30.0090.00316.54
7.2.20.0090.00616.86
7.2.10.0130.00016.78
7.2.00.0060.00818.10
7.1.250.0030.01215.76
7.1.70.0030.00517.09
7.1.60.0060.00616.99
7.1.50.0070.01117.02
7.1.00.0000.03722.45
7.0.200.0070.01516.82
7.0.140.0030.07022.04
7.0.60.0030.07720.05
7.0.50.0070.08017.89
7.0.40.0100.05720.23
7.0.30.0200.08020.08
7.0.20.0230.07720.07
7.0.10.0030.07720.13
7.0.00.0170.07320.11
5.6.280.0000.07720.91
5.6.210.0130.07020.71
5.6.200.0030.07718.19
5.6.190.0100.05720.77
5.6.180.0270.07320.55
5.6.170.0200.04020.55
5.6.160.0100.05720.39
5.6.150.0000.04318.27
5.6.140.0000.04318.15
5.6.130.0100.04318.26
5.6.120.0070.08721.10
5.6.110.0030.06721.11
5.6.100.0070.08020.99
5.6.90.0000.04321.00
5.6.80.0100.08020.37
5.5.350.0170.06020.48
5.5.340.0030.04018.05
5.5.330.0100.03320.21
5.5.320.0230.04020.27
5.5.310.0300.07720.34
5.5.300.0100.04318.07
5.5.290.0100.08318.02
5.5.280.0070.05320.69
5.5.270.0070.08720.89
5.5.260.0000.05720.87
5.5.250.0030.07720.62
5.5.240.0030.08020.07
5.4.450.0730.05319.61
5.4.440.0600.06319.48
5.4.430.0100.05319.52
5.4.420.0070.05719.42
5.4.410.0100.05318.72
5.4.400.0100.05318.80
5.4.390.0030.05718.55
5.4.380.0200.04318.74
5.4.370.0230.04718.76
5.4.360.0170.05018.73
5.4.350.0200.04718.75
5.4.340.0100.05718.81
5.4.320.0100.03312.51
5.4.310.0030.04212.50
5.4.300.0080.03712.50
5.4.290.0070.03712.50
5.4.280.0090.03312.40
5.4.270.0080.03712.40
5.4.260.0070.05719.04
5.4.250.0070.05318.75
5.4.240.0030.06018.79
5.4.230.0130.04718.95
5.4.220.0030.06318.99
5.4.210.0230.06319.00
5.4.200.0130.05318.72
5.4.190.0170.05018.98
5.4.180.0100.07318.98
5.4.170.0070.05318.80
5.4.160.0100.05318.64
5.4.150.0130.05319.08
5.4.140.0230.05716.40
5.4.130.0100.06316.41
5.4.120.0130.04716.38
5.4.110.0100.06316.55
5.4.100.0030.05716.53
5.4.90.0070.05716.55
5.4.80.0100.04716.53
5.4.70.0070.07316.42
5.4.60.0100.05016.39
5.4.50.0070.05016.51
5.4.40.0070.07016.41
5.4.30.0200.03716.54
5.4.20.0170.04316.54
5.4.10.0170.07016.37
5.4.00.0100.05315.79
5.3.290.0050.04912.80
5.3.280.0030.05014.68
5.3.270.0200.04714.60
5.3.260.0230.05714.68
5.3.250.0100.08014.83
5.3.240.0130.06714.58
5.3.230.0000.06014.43
5.3.220.0170.05014.57
5.3.210.0130.05014.63
5.3.200.0130.05014.57
5.3.190.0070.05014.56
5.3.180.0070.05314.72
5.3.170.0070.07014.55
5.3.160.0200.06014.47
5.3.150.0100.06714.64
5.3.140.0170.06014.57
5.3.130.0100.06314.57
5.3.120.0300.05714.62
5.3.110.0130.07014.38
5.3.100.0100.07014.13
5.3.90.0130.04313.99
5.3.80.0100.05014.11
5.3.70.0030.06314.20
5.3.60.0070.06014.15
5.3.50.0030.05014.17
5.3.40.0030.05314.03
5.3.30.0100.06013.82
5.3.20.0000.05013.72
5.3.10.0070.04713.82
5.3.00.0130.06013.61
5.2.170.0070.05011.14
5.2.160.0070.04011.14
5.2.150.0030.04311.14
5.2.140.0030.04711.12
5.2.130.0000.06011.18
5.2.120.0000.05010.94
5.2.110.0070.05311.09
5.2.100.0030.04711.01
5.2.90.0000.05311.17
5.2.80.0030.04011.05
5.2.70.0000.04711.16
5.2.60.0000.04711.04
5.2.50.0070.04010.86
5.2.40.0030.05310.83
5.2.30.0000.05711.15
5.2.20.0070.03710.93
5.2.10.0030.04010.84
5.2.00.0070.05010.95
5.1.60.0070.03010.15
5.1.50.0030.04010.00
5.1.40.0000.0409.93
5.1.30.0070.03010.29
5.1.20.0000.04010.57
5.1.10.0030.04710.03
5.1.00.0100.03710.07
5.0.50.0030.0338.55
5.0.40.0070.0378.64
5.0.30.0070.0408.15
5.0.20.0030.0338.20
5.0.10.0130.0338.22
5.0.00.0030.0438.20
4.4.90.0070.0177.21
4.4.80.0030.0207.21
4.4.70.0030.0207.21
4.4.60.0000.0237.21
4.4.50.0070.0177.21
4.4.40.0030.0437.21
4.4.30.0070.0207.21
4.4.20.0000.0277.21
4.4.10.0000.0237.21
4.4.00.0100.0277.21
4.3.110.0000.0237.21
4.3.100.0030.0337.21
4.3.90.0030.0207.21
4.3.80.0100.0277.21
4.3.70.0100.0137.21
4.3.60.0000.0237.21
4.3.50.0000.0277.21
4.3.40.0030.0337.21
4.3.30.0030.0277.21
4.3.20.0000.0277.21
4.3.10.0000.0237.21
4.3.00.0100.0336.76

preferences:
45.06 ms | 401 KiB | 5 Q