3v4l.org

run code in 300+ PHP versions simultaneously
<?php function time_diff($s) { $m = 0; $hr = 0; $d = 0; $td = "now"; if ($s > 59) { $m = (int)($s/60); $s = $s-($m*60); // sec left over $td = "$m min"; } if ($m > 59) { $hr = (int)($m / 60); $m = $m - ($hr*60); // min left over $td = "$hr hr"; if ($hr > 1) { $td .= "s"; } if ($m > 0) { $td .= ", $m min"; } } if ($hr > 23) { $d = (int) ($hr / 24); $hr = $hr-($d*24); // hr left over $td = "$d day"; if ($d > 1) { $td .= "s"; } if ($d < 3) { if ($hr > 0) { $td .= ", $hr hr"; } if ($hr > 1) { $td .= "s"; } } } return $td; } $diffInSecs = strtotime('14:00') - strtotime('9:00'); echo $diffInSecs; echo "<br>"; echo time_diff($diffInSecs);

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.0140.00718.43
8.3.50.0130.00521.33
8.3.40.0070.00718.98
8.3.30.0110.00719.17
8.3.20.0000.00720.16
8.3.10.0040.00423.47
8.3.00.0060.00319.50
8.2.180.0030.01416.50
8.2.170.0070.00722.96
8.2.160.0110.00420.39
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00022.09
8.2.110.0030.00722.08
8.2.100.0000.01117.75
8.2.90.0030.00519.17
8.2.80.0040.00417.97
8.2.70.0080.00017.88
8.2.60.0080.00318.05
8.2.50.0000.00918.07
8.2.40.0000.00818.35
8.2.30.0040.00418.18
8.2.20.0030.00517.86
8.2.10.0040.00418.20
8.2.00.0000.00817.77
8.1.280.0110.00325.92
8.1.270.0060.01323.97
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0040.00423.97
8.1.230.0080.00319.09
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0000.01217.25
8.1.190.0000.00917.36
8.1.180.0040.00418.10
8.1.170.0030.00620.40
8.1.160.0000.00721.95
8.1.150.0040.00418.81
8.1.140.0030.00517.50
8.1.130.0070.00017.77
8.1.120.0000.00717.63
8.1.110.0040.00417.58
8.1.100.0040.00317.66
8.1.90.0000.00717.54
8.1.80.0000.00717.66
8.1.70.0070.00017.58
8.1.60.0000.00817.65
8.1.50.0050.00317.61
8.1.40.0080.00017.67
8.1.30.0040.00417.79
8.1.20.0000.00817.69
8.1.10.0000.00817.56
8.1.00.0050.00317.68
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0070.00018.43
8.0.270.0000.00717.33
8.0.260.0000.00617.25
8.0.250.0000.00717.14
8.0.240.0000.00717.15
8.0.230.0050.00217.19
8.0.220.0040.00416.96
8.0.210.0030.00317.09
8.0.200.0030.00317.17
8.0.190.0080.00017.04
8.0.180.0040.00417.15
8.0.170.0080.00017.09
8.0.160.0070.00017.12
8.0.150.0000.00717.04
8.0.140.0000.00717.04
8.0.130.0000.00613.43
8.0.120.0040.00416.94
8.0.110.0040.00417.01
8.0.100.0000.00716.98
8.0.90.0000.00717.05
8.0.80.0080.00817.14
8.0.70.0040.00417.13
8.0.60.0000.00816.92
8.0.50.0050.00217.07
8.0.30.0130.00817.35
8.0.20.0100.01217.40
8.0.10.0040.00417.02
8.0.00.0130.00517.01
7.4.330.0060.00015.21
7.4.320.0000.00616.65
7.4.300.0040.00416.59
7.4.290.0000.01016.63
7.4.280.0060.00316.74
7.4.270.0070.00016.64
7.4.260.0000.00716.64
7.4.250.0000.00716.70
7.4.240.0000.00716.73
7.4.230.0030.00316.62
7.4.220.0030.01316.76
7.4.210.0100.00716.75
7.4.200.0000.00716.48
7.4.160.0070.01016.68
7.4.150.0000.01717.40
7.4.140.0050.01317.86
7.4.130.0080.01516.68
7.4.120.0100.00816.81
7.4.110.0080.01116.66
7.4.100.0110.00516.77
7.4.90.0120.00616.71
7.4.80.0120.00619.39
7.4.70.0120.00616.64
7.4.60.0040.01216.63
7.4.50.0000.00516.26
7.4.40.0150.00016.36
7.4.30.0100.00716.67
7.4.00.0060.01015.14
7.3.330.0030.00313.35
7.3.320.0000.00513.36
7.3.310.0000.00716.49
7.3.300.0000.00716.47
7.3.290.0080.00616.48
7.3.280.0110.00516.51
7.3.270.0160.00617.40
7.3.260.0040.01416.64
7.3.250.0080.00816.61
7.3.240.0080.00916.49
7.3.230.0100.00716.51
7.3.210.0070.01016.55
7.3.200.0020.01519.39
7.3.190.0110.00716.77
7.3.180.0080.00816.79
7.3.170.0090.01116.90
7.3.160.0090.00616.73
7.3.120.0070.01115.17
7.3.110.0170.00015.06
7.3.100.0130.00315.02
7.3.90.0060.00915.09
7.3.80.0100.00715.34
7.3.70.0070.00714.84
7.3.60.0030.01015.09
7.3.50.0080.00815.01
7.3.40.0090.00415.08
7.3.30.0000.00914.83
7.3.20.0030.00816.93
7.3.10.0080.00316.96
7.3.00.0050.01016.88
7.2.330.0140.00516.51
7.2.320.0030.01916.92
7.2.310.0110.01116.91
7.2.300.0060.01116.60
7.2.290.0070.01317.01
7.2.250.0070.01015.46
7.2.240.0090.00615.13
7.2.230.0070.01014.92
7.2.220.0090.00615.31
7.2.210.0000.01615.36
7.2.200.0040.00815.16
7.2.190.0060.00914.95
7.2.180.0030.01315.20
7.2.170.0060.00315.18
7.2.130.0040.01417.18
7.2.120.0060.00916.89
7.2.110.0040.01117.01
7.2.100.0110.00417.05
7.2.90.0100.00316.86
7.2.80.0080.00817.07
7.2.70.0040.00816.97
7.2.60.0030.01116.64
7.2.50.0090.00617.09
7.2.40.0040.00816.91
7.2.30.0080.00416.93
7.2.20.0030.01017.02
7.2.10.0000.01316.68
7.2.00.0050.00918.16
7.1.330.0070.01015.95
7.1.320.0090.00616.09
7.1.310.0060.00616.02
7.1.300.0100.00315.86
7.1.290.0070.00316.00
7.1.280.0030.00715.80
7.1.270.0070.00715.90
7.1.260.0030.00716.15
7.1.250.0030.01016.13
7.1.200.0030.00915.82
7.1.100.0040.00418.21
7.1.70.0090.00017.11
7.1.60.0230.00319.32
7.1.50.0110.01417.25
7.1.00.0070.07322.28
7.0.200.0030.00516.84
7.0.140.0030.07321.95
7.0.60.0100.07720.07
7.0.50.0100.07017.87
7.0.40.0030.05020.24
7.0.30.0170.04320.11
7.0.20.0230.08320.12
7.0.10.0270.05720.25
7.0.00.0130.08020.22
5.6.280.0100.06721.11
5.6.210.0130.08320.51
5.6.200.0130.08018.13
5.6.190.0000.08320.62
5.6.180.0230.08320.58
5.6.170.0230.05320.57
5.6.160.0100.04020.51
5.6.150.0100.05018.25
5.6.140.0030.04018.17
5.6.130.0070.05018.14
5.6.120.0070.08021.01
5.6.110.0030.08021.03
5.6.100.0270.06320.95
5.6.90.0130.07721.03
5.6.80.0070.07720.50
5.6.70.2730.04020.53
5.5.350.0100.08020.43
5.5.340.0130.06718.07
5.5.330.0070.03720.25
5.5.320.0300.03720.28
5.5.310.0300.04720.27
5.5.300.0100.03717.95
5.5.290.0000.09017.98
5.5.280.0070.04720.68
5.5.270.0000.04720.78
5.5.260.0030.09020.88
5.5.250.0100.08020.63
5.5.240.0300.06720.27
5.4.450.0930.06719.46
5.4.440.0700.07019.31
5.4.430.0970.07719.63
5.4.420.0800.07319.55
5.4.410.0200.04319.25
5.4.400.0730.05719.13
5.4.390.0930.06019.23
5.4.380.0270.05018.98
5.4.370.0870.05019.26
5.4.360.0700.06019.29
5.4.350.0770.06319.33
5.4.340.0020.03712.02
5.4.320.0050.03712.51
5.4.310.0050.03812.50
5.4.300.0020.03912.51
5.4.290.0080.03612.50
5.4.280.0060.03412.41
5.4.270.0050.03612.41
5.4.260.0060.03712.41
5.4.250.0040.04012.41
5.4.240.0050.03612.41
5.4.230.0080.03612.40
5.4.220.0080.03612.40
5.4.210.0050.03612.39
5.4.200.0090.03412.39
5.4.190.0060.04012.39
5.4.180.0070.03712.39
5.4.170.0040.04012.40
5.4.160.0030.03912.40
5.4.150.0060.03512.39
5.4.140.0060.04412.08
5.4.130.0100.03312.07
5.4.120.0080.03412.03
5.4.110.0070.03512.02
5.4.100.0060.03412.02
5.4.90.0080.03912.02
5.4.80.0030.03912.02
5.4.70.0050.03412.02
5.4.60.0090.03312.02
5.4.50.0060.03412.01
5.4.40.0060.03412.01
5.4.30.0040.03612.00
5.4.20.0080.03212.00
5.4.10.0080.03212.00
5.4.00.0040.03711.49
5.3.290.0030.04112.80
5.3.280.0060.03712.71
5.3.270.0090.03612.72
5.3.260.0060.04612.71
5.3.250.0040.03912.72
5.3.240.0070.03812.72
5.3.230.0050.04112.71
5.3.220.0050.04012.68
5.3.210.0090.03612.68
5.3.200.0060.03612.68
5.3.190.0050.03712.68
5.3.180.0120.03512.68
5.3.170.0060.03712.66
5.3.160.0040.03912.67
5.3.150.0050.03712.68
5.3.140.0060.03512.66
5.3.130.0070.03712.66
5.3.120.0060.03812.66
5.3.110.0120.03812.66
5.3.100.0040.03812.13
5.3.90.0050.03812.11
5.3.80.0060.03512.10
5.3.70.0060.03912.10
5.3.60.0060.03612.09
5.3.50.0060.03612.04
5.3.40.0030.03812.04
5.3.30.0080.03212.00
5.3.20.0050.03411.78
5.3.10.0080.03311.74
5.3.00.0080.04411.73
5.2.170.0050.0369.24
5.2.160.0030.0309.23
5.2.150.0020.0329.23
5.2.140.0060.0289.23
5.2.130.0040.0289.20
5.2.120.0050.0279.19
5.2.110.0080.0279.20
5.2.100.0030.0299.19
5.2.90.0050.0289.18
5.2.80.0060.0279.19
5.2.70.0060.0289.19
5.2.60.0070.0279.14
5.2.50.0020.0319.11
5.2.40.0020.0309.08
5.2.30.0070.0269.06
5.2.20.0020.0319.05
5.2.10.0050.0278.95
5.2.00.0060.0278.82
5.1.60.0030.0258.10
5.1.50.0050.0238.10
5.1.40.0070.0228.08
5.1.30.0020.0278.43
5.1.20.0070.0238.45
5.1.10.0060.0288.18
5.1.00.0050.0258.18
5.0.50.0080.0226.66
5.0.40.0040.0266.53
5.0.30.0050.0316.33
5.0.20.0020.0206.30
5.0.10.0040.0196.29
5.0.00.0030.0316.27
4.4.90.0040.0144.78
4.4.80.0020.0164.75
4.4.70.0040.0144.75
4.4.60.0040.0144.76
4.4.50.0050.0134.77
4.4.40.0020.0254.71
4.4.30.0030.0154.76
4.4.20.0020.0164.85
4.4.10.0010.0204.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0030.0144.67
4.3.90.0020.0154.63
4.3.80.0020.0254.58
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0040.0254.63
4.3.40.0040.0264.54
4.3.30.0010.0233.33
4.3.20.0020.0213.31
4.3.10.0020.0193.27
4.3.00.0130.0236.81

preferences:
36.28 ms | 401 KiB | 5 Q