3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xtemplate_formatter_secToTime($rawSeconds, $useSec = false, $convertHoursToDays = false) { $allSeconds = abs($rawSeconds); $days = floor($allSeconds / 86400); $hoursSeconds = $allSeconds - 86400 * $days; $hours = floor($hoursSeconds / 3600); $minutesSeconds = $hoursSeconds - 3600 * $hours; $minutes = floor($minutesSeconds / 60); if ($useSec) { $seconds = $minutesSeconds - 60 * $minutes; } if (!$convertHoursToDays) { $hours = $days * 24 + $hours; $days = 0; } if ($hours < 10) { $hours = "0" . $hours; } if ($minutes < 10) { $minutes = "0" . $minutes; } if ($useSec && $seconds < 10) { $seconds = "0" . $seconds; } $str = ''; if ($days > 0) { $str .= $days . 'd'; } $str = $str . $hours . ":" . $minutes; if ($useSec) { $str .= ":" . $seconds; } return $str; } echo xtemplate_formatter_secToTime(35353);

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.0170.00318.18
8.3.50.0150.00721.19
8.3.40.0080.00818.88
8.3.30.0170.00019.13
8.3.20.0050.00320.51
8.3.10.0040.00423.78
8.3.00.0080.00019.02
8.2.180.0100.01016.50
8.2.170.0120.00322.96
8.2.160.0130.00320.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00022.23
8.2.110.0080.00020.29
8.2.100.0110.00017.91
8.2.90.0000.00919.34
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0050.00318.03
8.2.50.0040.00418.07
8.2.40.0050.00319.80
8.2.30.0040.00417.95
8.2.20.0040.00417.77
8.2.10.0020.00518.20
8.2.00.0040.00417.79
8.1.280.0030.01025.92
8.1.270.0030.00524.02
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0040.00423.84
8.1.230.0110.00019.13
8.1.220.0030.00617.93
8.1.210.0000.00718.77
8.1.200.0060.00317.36
8.1.190.0030.00617.35
8.1.180.0000.00918.10
8.1.170.0060.00318.78
8.1.160.0040.00421.96
8.1.150.0000.00718.87
8.1.140.0000.00917.52
8.1.130.0030.00317.90
8.1.120.0040.00417.63
8.1.110.0040.00417.52
8.1.100.0000.00717.56
8.1.90.0000.00817.59
8.1.80.0070.00017.51
8.1.70.0030.00317.41
8.1.60.0000.00817.60
8.1.50.0030.00617.64
8.1.40.0040.00417.53
8.1.30.0050.00317.73
8.1.20.0000.00717.77
8.1.10.0040.00417.55
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.56
8.0.270.0070.00017.31
8.0.260.0080.00017.33
8.0.250.0050.00217.03
8.0.240.0030.00317.03
8.0.230.0070.00017.00
8.0.220.0000.00616.91
8.0.210.0070.00017.00
8.0.200.0000.00717.02
8.0.190.0000.00916.95
8.0.180.0000.00716.98
8.0.170.0040.00417.00
8.0.160.0040.00416.88
8.0.150.0020.00516.73
8.0.140.0000.00716.89
8.0.130.0000.00613.30
8.0.120.0000.00816.91
8.0.110.0050.00316.90
8.0.100.0000.00817.00
8.0.90.0040.00316.83
8.0.80.0110.01116.96
8.0.70.0040.00417.01
8.0.60.0040.00416.87
8.0.50.0000.00716.85
8.0.30.0080.01117.13
8.0.20.0090.01017.40
8.0.10.0040.00417.06
8.0.00.0070.01016.84
7.4.330.0060.00015.03
7.4.320.0030.00616.63
7.4.300.0000.00616.56
7.4.290.0020.00516.66
7.4.280.0050.00316.59
7.4.270.0070.00016.60
7.4.260.0030.00616.67
7.4.250.0030.00516.55
7.4.240.0040.00416.66
7.4.230.0030.00316.68
7.4.220.0100.00716.64
7.4.210.0100.01016.50
7.4.200.0070.00016.77
7.4.160.0090.00616.55
7.4.150.0170.00017.40
7.4.140.0110.01117.86
7.4.130.0070.01016.61
7.4.120.0030.01416.43
7.4.110.0070.01116.55
7.4.100.0070.01016.50
7.4.90.0060.01216.70
7.4.80.0110.00719.39
7.4.70.0190.00016.69
7.4.60.0030.01616.39
7.4.50.0060.00016.41
7.4.40.0030.01316.55
7.4.30.0120.00416.59
7.4.00.0070.01015.10
7.3.330.0000.00713.22
7.3.320.0000.00513.40
7.3.310.0000.00716.31
7.3.300.0030.00316.48
7.3.290.0080.00716.46
7.3.280.0080.00716.45
7.3.270.0110.01017.40
7.3.260.0120.00816.48
7.3.250.0060.01116.57
7.3.240.0090.00916.49
7.3.230.0060.01516.56
7.3.210.0120.00616.66
7.3.200.0030.01319.39
7.3.190.0090.00916.45
7.3.180.0060.01016.51
7.3.170.0110.00716.77
7.3.160.0120.00416.80
7.3.10.0070.00616.61
7.3.00.0060.00916.60
7.2.330.0120.00616.92
7.2.320.0030.02016.92
7.2.310.0090.00616.58
7.2.300.0030.01316.64
7.2.290.0090.01216.48
7.2.130.0040.00716.73
7.2.120.0000.01416.79
7.2.110.0030.01317.03
7.2.100.0040.00717.06
7.2.90.0070.00716.80
7.2.80.0130.00316.57
7.2.70.0030.00716.88
7.2.60.0080.00616.79
7.2.50.0070.00716.74
7.2.40.0000.01516.99
7.2.30.0040.00716.65
7.2.20.0040.01216.85
7.2.10.0000.01317.05
7.2.00.0020.01218.18
7.1.250.0030.01015.78
7.1.100.0070.00717.93
7.1.70.0110.00017.20
7.1.60.0140.01119.11
7.1.50.0140.01016.94
7.1.00.0070.07322.45
7.0.200.0040.00416.76
7.0.140.0000.07022.07
7.0.60.0170.08020.08
7.0.50.0170.07317.85
7.0.40.0130.04020.13
7.0.30.0300.07720.07
7.0.20.0370.05720.16
7.0.10.0230.05320.25
7.0.00.0030.09320.20
5.6.280.0000.07321.11
5.6.210.0070.05020.52
5.6.200.0100.04018.18
5.6.190.0070.04320.48
5.6.180.0030.08020.52
5.6.170.0430.07720.45
5.6.160.0030.04018.17
5.6.150.0100.03718.23
5.6.140.0070.07718.18
5.6.130.0030.05718.28
5.6.120.0100.07021.03
5.6.110.0170.08021.14
5.6.100.0170.07721.12
5.6.90.0000.05320.89
5.6.80.0070.07320.39
5.5.350.0130.09020.48
5.5.340.0130.08017.95
5.5.330.0100.08320.25
5.5.320.0500.06320.38
5.5.310.0170.04320.51
5.5.300.0070.03718.08
5.5.290.0100.07317.93
5.5.280.0030.08720.95
5.5.270.0200.07020.85
5.5.260.0070.08720.69
5.5.250.0070.08320.62
5.5.240.0170.06320.20
5.4.450.0270.07719.41
5.4.440.0970.07719.70
5.4.430.0130.05019.58
5.4.420.0700.04319.16
5.4.410.0600.06719.48
5.4.400.0500.05718.98
5.4.390.0770.05319.25
5.4.380.0800.05319.22
5.4.370.0770.06019.24
5.4.360.0630.05719.27
5.4.350.0730.06319.30
5.4.340.0040.04312.02
5.4.320.0080.05312.51
5.4.310.0080.05412.51
5.4.300.0060.04512.51
5.4.290.0100.05012.51
5.4.280.0030.04212.41
5.4.270.0050.03712.40
5.4.260.0060.04312.40
5.4.250.0130.04212.41
5.4.240.0080.03412.41
5.4.230.0030.04012.40
5.4.220.0060.03612.40
5.4.210.0050.03912.40
5.4.200.0030.04012.39
5.4.190.0040.03712.39
5.4.180.0040.03812.40
5.4.170.0030.04312.40
5.4.160.0040.04312.40
5.4.150.0070.03612.39
5.4.140.0070.03712.08
5.4.130.0060.03712.07
5.4.120.0080.03412.03
5.4.110.0090.03312.02
5.4.100.0060.03712.02
5.4.90.0040.03912.02
5.4.80.0060.03712.02
5.4.70.0040.03612.02
5.4.60.0050.03512.01
5.4.50.0040.03612.02
5.4.40.0040.03612.01
5.4.30.0080.03412.00
5.4.20.0040.03612.00
5.4.10.0100.03412.00
5.4.00.0060.05211.50
5.3.290.0030.04812.80
5.3.280.0050.03912.71
5.3.270.0070.04112.72
5.3.260.0070.03912.72
5.3.250.0100.03512.72
5.3.240.0050.04112.72
5.3.230.0100.03612.71
5.3.220.0040.04012.68
5.3.210.0110.03612.68
5.3.200.0090.03312.68
5.3.190.0050.03812.67
5.3.180.0110.04912.67
5.3.170.0080.03812.67
5.3.160.0080.04412.67
5.3.150.0120.04912.68
5.3.140.0070.05312.66
5.3.130.0120.05012.66
5.3.120.0090.05112.65
5.3.110.0070.05512.66
5.3.100.0080.05412.13
5.3.90.0050.04412.12
5.3.80.0070.03712.11
5.3.70.0050.03612.11
5.3.60.0050.03712.09
5.3.50.0040.04012.04
5.3.40.0040.03712.04
5.3.30.0040.03711.99
5.3.20.0070.03511.78
5.3.10.0070.03511.75
5.3.00.0040.03811.73
5.2.170.0060.0309.24
5.2.160.0050.0309.23
5.2.150.0050.0319.23
5.2.140.0060.0359.23
5.2.130.0060.0479.19
5.2.120.0040.0329.20
5.2.110.0040.0309.20
5.2.100.0030.0309.19
5.2.90.0060.0289.19
5.2.80.0050.0299.18
5.2.70.0050.0309.18
5.2.60.0020.0329.15
5.2.50.0020.0329.12
5.2.40.0050.0279.09
5.2.30.0040.0299.06
5.2.20.0060.0289.05
5.2.10.0040.0288.97
5.2.00.0040.0308.84
5.1.60.0050.0238.12
5.1.50.0040.0258.12
5.1.40.0050.0238.09
5.1.30.0040.0278.45
5.1.20.0090.0228.47
5.1.10.0060.0258.19
5.1.00.0050.0268.20
5.0.50.0010.0256.68
5.0.40.0020.0216.54
5.0.30.0010.0336.35
5.0.20.0030.0206.31
5.0.10.0030.0206.30
5.0.00.0020.0316.29
4.4.90.0030.0174.78
4.4.80.0010.0174.76
4.4.70.0040.0144.75
4.4.60.0030.0184.75
4.4.50.0050.0154.77
4.4.40.0020.0264.71
4.4.30.0050.0134.76
4.4.20.0010.0244.84
4.4.10.0020.0234.85
4.4.00.0030.0274.76
4.3.110.0030.0164.67
4.3.100.0050.0134.67
4.3.90.0010.0174.63
4.3.80.0060.0314.59
4.3.70.0020.0194.63
4.3.60.0050.0144.63
4.3.50.0030.0164.63
4.3.40.0000.0274.54
4.3.30.0020.0163.34
4.3.20.0030.0153.32
4.3.10.0020.0153.28
4.3.00.0100.0277.04

preferences:
39.07 ms | 401 KiB | 5 Q