3v4l.org

run code in 300+ PHP versions simultaneously
<?php function oldFormatSeconds($ss) { $result = ''; $s = $ss % 60; $m = floor(($ss % 3600) / 60); $h = floor(($ss % 86400) / 3600); $d = floor(($ss % 2592000) / 86400); if ($d > 0) { $result .= $d . 'd, '; } if ($h > 0) { $result .= $h . 'h '; } if ($m > 0 || $s > 0) { $result .= $m . 'm '; } if ($s > 0) { $result .= $s . 's '; } return $result; } function formatSeconds($s) { return gmdate("H i s\s", 1000); } echo oldFormatSeconds(1000); echo "\n"; echo formatSeconds(1000);

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.00716.50
8.3.50.0140.00418.05
8.3.40.0040.01118.86
8.3.30.0120.00318.73
8.3.20.0000.00721.98
8.3.10.0040.00421.93
8.3.00.0080.00019.50
8.2.180.0070.00718.18
8.2.170.0060.00922.96
8.2.160.0100.00320.35
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00019.83
8.2.120.0030.00526.35
8.2.110.0060.00320.70
8.2.100.0040.00717.97
8.2.90.0050.00317.74
8.2.80.0040.00419.29
8.2.70.0080.00018.16
8.2.60.0050.00517.97
8.2.50.0040.00418.10
8.2.40.0020.00520.66
8.2.30.0050.00219.41
8.2.20.0000.00718.12
8.2.10.0050.00218.09
8.2.00.0040.00417.86
8.1.280.0150.00625.92
8.1.270.0070.00720.38
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0070.00419.09
8.1.220.0040.00417.79
8.1.210.0080.00018.77
8.1.200.0040.00417.50
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0060.00318.84
8.1.160.0000.00718.90
8.1.150.0030.00720.35
8.1.140.0000.00719.70
8.1.130.0070.00019.16
8.1.120.0030.00517.59
8.1.110.0040.00417.43
8.1.100.0030.00617.64
8.1.90.0000.00817.50
8.1.80.0030.00617.60
8.1.70.0050.00317.61
8.1.60.0030.00617.59
8.1.50.0080.00017.50
8.1.40.0000.00817.53
8.1.30.0000.00917.61
8.1.20.0070.00017.63
8.1.10.0040.00417.56
8.1.00.0040.00417.55
8.0.300.0000.00719.64
8.0.290.0080.00016.75
8.0.280.0030.00318.46
8.0.270.0040.00317.21
8.0.260.0060.00017.28
8.0.250.0030.00517.15
8.0.240.0050.00217.04
8.0.230.0000.00617.03
8.0.220.0000.00717.07
8.0.210.0000.00717.10
8.0.200.0000.00716.99
8.0.190.0030.00517.06
8.0.180.0070.00017.06
8.0.170.0000.00816.91
8.0.160.0030.00316.97
8.0.150.0000.00716.94
8.0.140.0070.00016.83
8.0.130.0000.00513.42
8.0.120.0070.00016.98
8.0.110.0070.00017.03
8.0.100.0040.00417.01
8.0.90.0040.00416.88
8.0.80.0160.00016.97
8.0.70.0040.00416.89
8.0.60.0040.00416.86
8.0.50.0000.00816.93
8.0.30.0120.00617.07
8.0.20.0100.00917.40
8.0.10.0050.00216.88
8.0.00.0100.00716.79
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0030.00316.68
7.4.290.0030.00716.30
7.4.280.0040.00416.53
7.4.270.0000.00716.70
7.4.260.0070.00016.48
7.4.250.0000.00716.61
7.4.240.0040.00416.72
7.4.230.0070.00016.48
7.4.220.0130.01216.69
7.4.210.0070.00716.73
7.4.200.0020.00516.69
7.4.160.0100.00816.65
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0100.00616.48
7.4.120.0130.00916.63
7.4.110.0060.01216.73
7.4.100.0130.00916.59
7.4.90.0100.00716.55
7.4.80.0130.00919.39
7.4.70.0120.00316.62
7.4.60.0120.00416.54
7.4.50.0030.01216.71
7.4.40.0130.01016.61
7.4.30.0130.00316.47
7.4.10.0090.00915.11
7.4.00.0120.00314.72
7.3.330.0050.00013.34
7.3.320.0030.00313.37
7.3.310.0040.00416.29
7.3.300.0070.00016.27
7.3.290.0070.00716.39
7.3.280.0140.00316.36
7.3.270.0110.00617.40
7.3.260.0120.00516.61
7.3.250.0110.00816.54
7.3.240.0120.01016.67
7.3.230.0140.00316.62
7.3.210.0130.00816.66
7.3.200.0100.00716.46
7.3.190.0060.01016.47
7.3.180.0170.00016.44
7.3.170.0070.01016.62
7.3.160.0100.01416.59
7.3.130.0090.00914.75
7.3.120.0070.01014.77
7.3.110.0030.01315.05
7.3.100.0090.00614.90
7.3.90.0080.00414.77
7.3.80.0040.00414.59
7.3.70.0030.01014.66
7.3.60.0000.01714.89
7.3.50.0030.01714.46
7.3.40.0030.00714.89
7.3.30.0000.01314.79
7.3.20.0090.00316.68
7.3.10.0060.00916.40
7.3.00.0100.00616.48
7.2.330.0130.01016.57
7.2.320.0100.00716.79
7.2.310.0080.00817.00
7.2.300.0090.00916.64
7.2.290.0100.01016.68
7.2.260.0070.01014.85
7.2.250.0090.00915.05
7.2.240.0030.01014.99
7.2.230.0000.01515.06
7.2.220.0070.01015.25
7.2.210.0090.00614.87
7.2.200.0090.00615.12
7.2.190.0130.00315.18
7.2.180.0000.01414.96
7.2.170.0030.01515.13
7.2.160.0040.00815.14
7.2.150.0030.00916.60
7.2.140.0100.00716.71
7.2.130.0030.00616.91
7.2.120.0030.01216.93
7.2.110.0070.00716.80
7.2.100.0060.00616.95
7.2.90.0030.00916.99
7.2.80.0070.00716.96
7.2.70.0070.00716.66
7.2.60.0030.01116.97
7.2.50.0090.00916.88
7.2.40.0000.01416.93
7.2.30.0040.00817.01
7.2.20.0070.01017.00
7.2.10.0080.00816.93
7.2.00.0110.00416.90
7.1.330.0090.00615.81
7.1.320.0070.01115.72
7.1.310.0040.00415.87
7.1.300.0000.01015.73
7.1.290.0080.01115.46
7.1.280.0070.00715.71
7.1.270.0070.00415.75
7.1.260.0000.01115.87
7.1.250.0030.00915.62
7.1.240.0090.00315.59
7.1.230.0000.01515.89
7.1.220.0120.00315.80
7.1.210.0080.00315.71
7.1.200.0060.00715.77
7.1.190.0080.00415.90
7.1.180.0030.01015.91
7.1.170.0090.00315.91
7.1.160.0000.00815.51
7.1.150.0060.00915.69
7.1.140.0040.01115.77
7.1.130.0070.00315.80
7.1.120.0100.00315.56
7.1.110.0040.01115.81
7.1.100.0100.00715.89
7.1.90.0040.00815.92
7.1.80.0060.00315.90
7.1.70.0000.01116.66
7.1.60.0070.00916.42
7.1.50.0100.00715.56
7.1.40.0030.01015.82
7.1.30.0030.01015.82
7.1.20.0060.00415.55
7.1.10.0050.03619.07
7.1.00.0100.03918.99
7.0.330.0090.00315.49
7.0.320.0130.00015.38
7.0.310.0000.01115.57
7.0.300.0070.00315.41
7.0.290.0000.01515.07
7.0.280.0030.00815.20
7.0.270.0060.00615.46
7.0.260.0030.01015.46
7.0.250.0000.01515.36
7.0.240.0090.00615.37
7.0.230.0000.01215.21
7.0.220.0040.00815.39
7.0.210.0060.00315.31
7.0.200.0050.00616.10
7.0.190.0070.00715.52
7.0.180.0040.01115.47
7.0.170.0080.00315.52
7.0.160.0060.01015.16
7.0.150.0080.03418.67
7.0.140.0100.03118.54
7.0.130.0080.03818.72
7.0.120.0060.03118.60
7.0.110.0070.03218.56
7.0.100.0050.03418.56
7.0.90.0090.02718.64
7.0.80.0030.03318.65
7.0.70.0100.02818.46
7.0.60.0100.02718.57
7.0.50.0100.03018.60
7.0.40.0070.03217.64
7.0.30.0120.02817.58
7.0.20.0050.03617.67
7.0.10.0050.03417.62
7.0.00.0050.03117.61
5.6.400.0000.01614.63
5.6.390.0080.00614.20
5.6.380.0070.01014.43
5.6.370.0100.00014.68
5.6.360.0030.00914.71
5.6.350.0030.00714.32
5.6.340.0040.00814.18
5.6.330.0040.00814.21
5.6.320.0000.01614.56
5.6.310.0040.00814.26
5.6.300.0030.00614.38
5.6.290.0100.00314.27
5.6.280.0040.00714.19
5.6.270.0060.00914.46
5.6.260.0120.00314.26
5.6.250.0100.00714.40
5.6.240.0070.00714.62
5.6.230.0070.01014.23
5.6.220.0060.01014.12
5.6.210.0000.01414.64
5.6.200.0060.00914.48
5.6.190.0100.00714.28
5.6.180.0060.00914.39
5.6.170.0000.01514.44
5.6.160.0040.00414.37
5.6.150.0060.00714.26
5.6.140.0100.00314.32
5.6.130.0060.00814.18
5.6.120.0040.00414.39
5.6.110.0030.01014.54
5.6.100.0000.00914.23
5.6.90.0030.00614.37
5.6.80.0070.00714.18
5.6.70.0000.01414.17
5.6.60.0060.00914.34
5.6.50.0040.00414.11
5.6.40.0140.00014.16
5.6.30.0000.00814.09
5.6.20.0030.01014.33
5.6.10.0090.00314.32
5.6.00.0070.00714.42

preferences:
57.79 ms | 401 KiB | 5 Q