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 * 3600); $interval = new \DateInterval("PT{$hours}H{$minutes}M{$seconds}S"); return $interval; } echo decTimeToInterval(1.6890000)->format("%H:%I");

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.0070.01018.68
8.3.50.0070.01322.04
8.3.40.0040.01118.84
8.3.30.0080.00619.16
8.3.20.0000.00720.34
8.3.10.0040.00423.52
8.3.00.0080.00019.50
8.2.180.0120.00318.29
8.2.170.0070.01422.96
8.2.160.0070.00720.52
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.28
8.2.110.0060.00322.12
8.2.100.0090.00319.57
8.2.90.0030.00519.26
8.2.80.0030.00517.97
8.2.70.0060.00317.75
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0030.00620.00
8.2.30.0040.00418.07
8.2.20.0050.00317.80
8.2.10.0000.00718.07
8.2.00.0060.00317.75
8.1.280.0140.00425.92
8.1.270.0060.00322.19
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00323.92
8.1.230.0090.00319.23
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0030.00717.48
8.1.190.0040.00417.35
8.1.180.0070.00018.10
8.1.170.0060.00318.59
8.1.160.0040.00421.98
8.1.150.0040.00418.88
8.1.140.0070.00017.53
8.1.130.0000.00717.91
8.1.120.0000.00817.50
8.1.110.0000.00717.52
8.1.100.0000.00717.44
8.1.90.0040.00417.49
8.1.80.0030.00317.45
8.1.70.0070.00017.54
8.1.60.0000.00817.61
8.1.50.0050.00317.62
8.1.40.0030.00517.59
8.1.30.0080.00017.58
8.1.20.0040.00417.63
8.1.10.0040.00417.50
8.1.00.0030.00617.53
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0000.00718.52
8.0.270.0030.00317.25
8.0.260.0040.00417.40
8.0.250.0030.00317.11
8.0.240.0030.00317.12
8.0.230.0000.00717.12
8.0.220.0050.00317.09
8.0.210.0040.00417.02
8.0.200.0060.00317.07
8.0.190.0020.00517.10
8.0.180.0000.00817.02
8.0.170.0040.00416.88
8.0.160.0050.00317.14
8.0.150.0040.00416.90
8.0.140.0000.00716.87
8.0.130.0030.00313.41
8.0.120.0000.00816.98
8.0.110.0040.00416.98
8.0.100.0070.00016.81
8.0.90.0040.00416.86
8.0.80.0090.00617.09
8.0.70.0050.00217.05
8.0.60.0030.00616.98
8.0.50.0040.00417.05
8.0.30.0110.00917.24
8.0.20.0120.00717.40
8.0.10.0050.00317.16
8.0.00.0110.01216.83
7.4.330.0000.00615.02
7.4.320.0070.00016.42
7.4.300.0000.00616.43
7.4.290.0040.00416.59
7.4.280.0050.00216.56
7.4.270.0030.00516.73
7.4.260.0040.00716.46
7.4.250.0070.00016.56
7.4.240.0050.00316.54
7.4.230.0030.00316.57
7.4.220.0080.01216.71
7.4.210.0030.01216.79
7.4.200.0000.00816.48
7.4.160.0060.01216.57
7.4.150.0100.00617.40
7.4.140.0130.01117.86
7.4.130.0080.01116.59
7.4.120.0100.00716.63
7.4.110.0030.01316.65
7.4.100.0120.00616.63
7.4.90.0100.00716.54
7.4.80.0130.00319.39
7.4.70.0030.01716.61
7.4.60.0090.00916.63
7.4.50.0000.00816.64
7.4.40.0030.01416.77
7.4.30.0070.01116.57
7.4.00.0100.00314.55
7.3.330.0030.00313.44
7.3.320.0060.00013.47
7.3.310.0050.00216.63
7.3.300.0030.00316.55
7.3.290.0070.01016.49
7.3.280.0090.00816.51
7.3.270.0090.00917.40
7.3.260.0080.01116.69
7.3.250.0110.00816.64
7.3.240.0100.00716.68
7.3.230.0130.00316.62
7.3.210.0100.00716.75
7.3.200.0100.01019.39
7.3.190.0070.01016.54
7.3.180.0060.00916.56
7.3.170.0120.00916.64
7.3.160.0140.00716.46
7.2.330.0100.00716.70
7.2.320.0120.00416.54
7.2.310.0080.00816.84
7.2.300.0000.01616.76
7.2.290.0240.02516.66
7.2.60.0060.00616.63
7.2.00.0050.00519.39
7.1.200.0040.00815.76
7.1.100.0000.01418.34
7.1.70.0100.00717.24
7.1.60.0100.01019.11
7.1.50.0100.01317.12
7.1.00.0000.08022.51
7.0.200.0000.01016.63
7.0.140.0000.07022.09
7.0.60.0100.07020.04
7.0.50.0030.05317.90
7.0.40.0070.04020.24
7.0.30.0230.06720.08
7.0.20.0270.03020.06
7.0.10.0170.07720.33
7.0.00.0100.05020.11
5.6.210.0100.04320.57
5.6.200.0130.07318.16
5.6.190.0000.09320.48
5.6.180.0130.04720.61
5.6.170.0300.07320.47
5.6.160.0100.08020.71
5.6.150.0200.06718.19
5.6.140.0000.04018.15
5.6.130.0070.04018.21
5.6.120.0070.05321.13
5.6.110.0000.04320.89
5.6.100.0130.07021.05
5.6.90.0070.07021.00
5.6.80.0000.06020.38
5.6.70.1370.06720.34
5.5.350.0130.04320.30
5.5.340.0000.06317.96
5.5.330.0030.06020.23
5.5.320.0030.05320.35
5.5.310.0230.04720.28
5.5.300.0030.04018.03
5.5.290.0070.05718.07
5.5.280.0130.07320.80
5.5.270.0070.09020.93
5.5.260.0100.05020.64
5.5.250.0030.07720.66
5.5.240.0270.07020.19
5.4.450.0730.05719.46
5.4.440.0830.07019.53
5.4.430.0930.06319.61
5.4.420.0630.00019.46
5.4.410.0700.00019.42
5.4.400.0630.00019.33
5.4.390.0870.00019.02
5.4.380.0630.00019.26
5.4.370.0870.00019.16
5.4.360.0670.00019.16
5.4.350.0630.00019.07
5.4.340.0060.03512.04
5.4.320.0040.03912.53
5.4.310.0030.04112.52
5.4.300.0060.03712.53
5.4.290.0060.03812.52
5.4.280.0040.03712.42
5.4.270.0030.03812.43
5.4.260.0050.04512.42
5.4.250.0030.04012.42
5.4.240.0050.03612.42
5.4.230.0050.03712.41
5.4.220.0050.03612.41
5.4.210.0070.03312.41
5.4.200.0070.03612.41
5.4.190.0050.03812.41
5.4.180.0030.04112.41
5.4.170.0060.04112.42
5.4.160.0050.03812.41
5.4.150.0050.03812.41
5.4.140.0060.03612.10
5.4.130.0070.03312.09
5.4.120.0050.03612.04
5.4.110.0070.03512.04
5.4.100.0060.04212.04
5.4.90.0070.04112.04
5.4.80.0100.04412.04
5.4.70.0050.03712.04
5.4.60.0070.03412.04
5.4.50.0080.03612.03
5.4.40.0060.03512.02
5.4.30.0080.03412.02
5.4.20.0040.03712.02
5.4.10.0040.03712.02
5.4.00.0030.04011.51
5.3.290.0040.04012.80
5.3.280.0060.03612.72
5.3.270.0060.04012.73
5.3.260.0040.04112.73
5.3.250.0050.03912.73
5.3.240.0070.03512.74
5.3.230.0050.03812.73
5.3.220.0040.03712.70
5.3.210.0070.03712.70
5.3.200.0040.03812.69
5.3.190.0050.03912.69
5.3.180.0070.03412.69
5.3.170.0080.03312.70
5.3.160.0090.03212.70
5.3.150.0030.04012.69
5.3.140.0080.03412.68
5.3.130.0060.03812.68
5.3.120.0040.04012.68
5.3.110.0060.03812.68
5.3.100.0040.03812.16
5.3.90.0020.04012.14
5.3.80.0070.03512.13
5.3.70.0070.03412.13
5.3.60.0060.03512.12
5.3.50.0030.03812.06
5.3.40.0040.03812.06
5.3.30.0090.03112.02
5.3.20.0040.03611.80
5.3.10.0060.03311.77
5.3.00.0080.03411.76
5.2.170.0060.0299.22
5.2.160.0050.0299.22
5.2.150.0030.0319.22
5.2.140.0030.0319.21
5.2.130.0080.0259.18
5.2.120.0060.0269.18
5.2.110.0040.0299.18
5.2.100.0050.0279.18
5.2.90.0050.0289.18
5.2.80.0050.0299.18
5.2.70.0050.0309.17
5.2.60.0030.0319.13
5.2.50.0050.0319.10
5.2.40.0030.0309.08
5.2.30.0040.0309.05
5.2.20.0060.0269.04
5.2.10.0030.0298.95
5.2.00.0070.0268.81
5.1.60.0030.0248.09
5.1.50.0040.0248.09
5.1.40.0040.0248.06
5.1.30.0040.0268.42
5.1.20.0040.0278.43
5.1.10.0010.0288.17
5.1.00.0020.0268.17
5.0.50.0070.0256.64
5.0.40.0060.0166.50
5.0.30.0030.0336.31
5.0.20.0020.0216.30
5.0.10.0050.0186.29
5.0.00.0040.0336.28
4.4.90.0010.0174.78
4.4.80.0030.0144.75
4.4.70.0020.0164.75
4.4.60.0040.0134.76
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0050.0124.76
4.4.20.0020.0154.84
4.4.10.0010.0164.85
4.4.00.0010.0264.76
4.3.110.0040.0144.67
4.3.100.0010.0164.67
4.3.90.0000.0174.63
4.3.80.0020.0244.58
4.3.70.0010.0164.63
4.3.60.0010.0164.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0010.0173.33
4.3.20.0030.0153.31
4.3.10.0020.0163.27
4.3.00.0100.0237.29

preferences:
50.41 ms | 401 KiB | 5 Q