3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Converts a 'decimal time' in the format 1.5hours to DateInterval object * * @param Int $decimalTime * @return DateInterval */ function decTimeToInterval($decimalTime) { $hours = floor($decimalTime); $decimalTime -= $hours; $minutes = floor($decimalTime * 60); $decimalTime -= ($minutes/60); $seconds = floor($decimalTime * 600); $interval = new \DateInterval("PT{$hours}H{$minutes}M{$seconds}S"); return $interval; } echo decTimeToInterval(4.5)->format("%H:%I:%S");

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.0090.00616.50
8.3.50.0110.00817.28
8.3.40.0070.01418.83
8.3.30.0070.00718.79
8.3.20.0050.00318.90
8.3.10.0040.00418.73
8.3.00.0030.00519.38
8.2.180.0110.00418.14
8.2.170.0050.01022.96
8.2.160.0030.01220.47
8.2.150.0030.00524.18
8.2.140.0030.00624.66
8.2.130.0000.00726.16
8.2.120.0040.00422.20
8.2.110.0040.00722.18
8.2.100.0090.00318.03
8.2.90.0000.00918.03
8.2.80.0000.00817.97
8.2.70.0030.00517.50
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0070.00018.04
8.2.20.0000.00717.74
8.2.10.0050.00317.71
8.2.00.0040.00417.68
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.98
8.1.230.0040.00821.03
8.1.220.0040.00417.74
8.1.210.0000.00818.92
8.1.200.0030.00917.48
8.1.190.0050.00317.66
8.1.180.0000.00818.10
8.1.170.0030.00518.59
8.1.160.0040.00418.89
8.1.150.0000.00818.69
8.1.140.0050.00217.55
8.1.130.0000.00717.94
8.1.120.0000.00717.44
8.1.110.0000.00717.34
8.1.100.0000.00717.39
8.1.90.0000.00717.52
8.1.80.0000.00717.57
8.1.70.0000.00817.41
8.1.60.0030.00617.53
8.1.50.0050.00317.48
8.1.40.0040.00417.50
8.1.30.0000.00717.72
8.1.20.0000.00817.72
8.1.10.0040.00417.60
8.1.00.0040.00417.55
8.0.300.0000.00720.02
8.0.290.0060.00316.75
8.0.280.0080.00018.54
8.0.270.0030.00317.33
8.0.260.0030.00316.82
8.0.250.0000.00716.93
8.0.240.0000.00716.95
8.0.230.0000.00716.91
8.0.220.0040.00416.95
8.0.210.0000.00716.96
8.0.200.0030.00317.07
8.0.190.0000.00716.86
8.0.180.0000.01016.86
8.0.170.0000.00916.95
8.0.160.0040.00417.05
8.0.150.0050.00516.86
8.0.140.0080.00416.93
8.0.130.0000.00513.34
8.0.120.0000.00716.94
8.0.110.0040.00416.91
8.0.100.0000.00716.86
8.0.90.0000.00816.90
8.0.80.0030.01216.88
8.0.70.0000.00716.95
8.0.60.0020.00516.94
8.0.50.0050.00217.01
8.0.30.0080.01117.03
8.0.20.0110.00816.96
8.0.10.0040.00417.06
8.0.00.0100.00816.71
7.4.330.0060.00012.91
7.4.320.0000.00616.52
7.4.300.0000.00616.54
7.4.290.0100.00016.70
7.4.280.0000.00716.66
7.4.270.0030.00616.60
7.4.260.0030.00313.32
7.4.250.0020.00516.66
7.4.240.0030.00516.57
7.4.230.0050.00216.47
7.4.220.0090.01016.55
7.4.210.0080.00816.64
7.4.200.0040.00416.59
7.4.190.0040.00416.53
7.4.160.0050.01116.65
7.4.150.0060.01216.57
7.4.140.0120.00516.51
7.4.130.0100.00816.45
7.4.120.0130.00516.48
7.4.110.0150.00616.68
7.4.100.0090.00916.53
7.4.90.0150.00316.54
7.4.80.0120.00616.45
7.4.70.0120.00616.64
7.4.60.0170.00616.64
7.4.50.0080.00516.41
7.4.40.0090.00616.34
7.4.30.0100.01616.54
7.4.00.0000.01415.12
7.3.330.0000.00613.22
7.3.320.0000.00513.22
7.3.310.0040.00416.49
7.3.300.0000.00716.43
7.3.290.0140.01116.39
7.3.280.0080.01016.40
7.3.270.0030.01416.42
7.3.260.0000.01916.44
7.3.250.0140.00816.58
7.3.240.0100.00716.54
7.3.230.0080.00916.79
7.3.210.0080.00816.46
7.3.200.0140.00719.39
7.3.190.0110.01116.40
7.3.180.0150.00316.70
7.3.170.0060.01116.55
7.3.160.0090.00616.59
7.3.120.0100.00614.86
7.2.330.0120.00616.92
7.2.320.0110.00716.86
7.2.310.0030.01716.71
7.2.300.0060.01016.90
7.2.290.0120.00316.59
7.2.00.0030.00919.46
7.1.100.0030.00618.08
7.1.70.0050.00516.80
7.1.60.0000.02519.40
7.1.50.0030.01516.75
7.1.00.0030.03722.54
7.0.200.0050.00316.67
7.0.140.0000.07721.96
7.0.120.0030.06322.15
7.0.60.0030.04719.83
7.0.50.0030.08717.89
7.0.40.0070.08320.11
7.0.30.0330.05720.13
7.0.20.0300.08020.09
7.0.10.0230.05020.23
7.0.00.0030.08320.10
5.6.280.0030.07320.82
5.6.210.0070.08020.53
5.6.200.0130.06718.22
5.6.190.0130.07020.61
5.6.180.0200.04320.36
5.6.170.0400.07720.43
5.6.160.0030.09020.50
5.6.150.0130.03318.15
5.6.140.0070.08018.18
5.6.130.0100.07718.18
5.6.120.0030.07021.09
5.6.110.0070.07021.05
5.6.100.0100.08021.13
5.6.90.0130.05320.97
5.6.80.0000.04020.38
5.6.70.0330.06320.35
5.5.350.0230.04320.41
5.5.340.0000.05018.02
5.5.330.0170.05720.39
5.5.320.0130.04020.19
5.5.310.0330.06720.30
5.5.300.0030.06018.05
5.5.290.0100.06318.08
5.5.280.0030.05020.85
5.5.270.0100.03320.74
5.5.260.0170.06720.80
5.5.250.0130.07320.58
5.5.240.0030.04020.26
5.4.450.0030.04019.19
5.4.440.0070.07719.53
5.4.430.0030.04319.25
5.4.420.0130.03019.25
5.4.410.0100.07719.34
5.4.400.0030.05319.25
5.4.390.0100.06318.85
5.4.380.0100.07318.85
5.4.370.0070.06719.15
5.4.360.0000.08719.14
5.4.350.0100.06018.98
5.4.340.0100.07719.00
5.4.320.0000.04318.87
5.4.310.0000.08019.20
5.4.300.0070.06718.85
5.4.290.0030.07718.84
5.4.280.0100.06319.14
5.4.270.0100.03718.97
5.4.260.0100.07019.12
5.4.250.0070.05318.95
5.4.240.0070.05719.20
5.4.230.0070.04318.85
5.4.220.0070.04018.86
5.4.210.0070.06319.13
5.4.200.0100.08019.15
5.4.190.0070.03719.11
5.4.180.0100.07719.23
5.4.170.0100.04019.23
5.4.160.0030.07318.83
5.4.150.0030.05319.05
5.4.140.0070.06316.45
5.4.130.0100.04316.44
5.4.120.0070.07316.60
5.4.110.0100.05716.35
5.4.100.0070.07716.58
5.4.90.0130.07016.54
5.4.80.0070.07316.51
5.4.70.0030.07316.46
5.4.60.0030.05716.39
5.4.50.0070.05016.50
5.4.40.0130.05316.45
5.4.30.0070.06016.40
5.4.20.0130.07016.41
5.4.10.0030.03716.38
5.4.00.0000.06315.79
5.3.290.0030.07714.66
5.3.280.0070.07314.48
5.3.270.0170.05714.64
5.3.260.0030.06714.51
5.3.250.0030.07714.49
5.3.240.0030.04014.62
5.3.230.0070.07014.59
5.3.220.0130.06314.57
5.3.210.0100.07714.57
5.3.200.0100.07014.61
5.3.190.0070.04314.57
5.3.180.0030.04314.59
5.3.170.0030.03714.61
5.3.160.0000.06014.59
5.3.150.0070.03714.45
5.3.140.0070.04714.56
5.3.130.0030.07714.57
5.3.120.0030.04014.56
5.3.110.0030.04714.59
5.3.100.0170.07014.05
5.3.90.0130.07014.01
5.3.80.0170.04714.03
5.3.70.0000.06014.18
5.3.60.0000.07014.03
5.3.50.0070.07713.98
5.3.40.0100.07013.89
5.3.30.0130.05313.83
5.3.20.0070.05713.76
5.3.10.0070.04013.66
5.3.00.0030.05013.63
5.2.170.0030.03011.19
5.2.160.0070.06011.18
5.2.150.0030.05311.09
5.2.140.0030.05311.20
5.2.130.0000.04311.11
5.2.120.0000.05011.15
5.2.110.0100.05011.09
5.2.100.0100.05711.05
5.2.90.0070.06311.02
5.2.80.0100.02311.09
5.2.70.0070.02711.04
5.2.60.0000.04311.09
5.2.50.0100.02311.02
5.2.40.0030.03011.14
5.2.30.0030.03710.96
5.2.20.0070.03310.97
5.2.10.0070.05011.02
5.2.00.0130.05310.72
5.1.60.0000.04310.15
5.1.50.0030.0279.91
5.1.40.0130.0309.95
5.1.30.0030.03710.39
5.1.20.0030.05710.41
5.1.10.0070.05010.23
5.1.00.0070.02710.12
5.0.50.0000.0478.54
5.0.40.0070.0378.32
5.0.30.0030.0338.29
5.0.20.0000.0438.22
5.0.10.0000.0478.19
5.0.00.0030.0438.15
4.4.90.0000.0177.77
4.4.80.0030.0137.77
4.4.70.0000.0277.77
4.4.60.0000.0407.77
4.4.50.0000.0337.77
4.4.40.0000.0377.77
4.4.30.0030.0237.77
4.4.20.0030.0307.77
4.4.10.0000.0177.77
4.4.00.0070.0377.77
4.3.110.0000.0237.77
4.3.100.0030.0377.77
4.3.90.0000.0307.77
4.3.80.0070.0477.77
4.3.70.0030.0337.77
4.3.60.0030.0307.77
4.3.50.0070.0207.77
4.3.40.0030.0407.77
4.3.30.0000.0207.77
4.3.20.0000.0407.77
4.3.10.0000.0177.77
4.3.00.0000.0177.77

preferences:
47.4 ms | 401 KiB | 5 Q