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'); $hours = $diffInSecs / 3600; echo $hours; 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.70.0040.01416.75
8.3.60.0100.00718.43
8.3.50.0140.01222.08
8.3.40.0150.00018.76
8.3.30.0110.00419.09
8.3.20.0070.00020.34
8.3.10.0080.00023.70
8.3.00.0030.00519.50
8.2.180.0090.00616.63
8.2.170.0110.00422.96
8.2.160.0070.00720.27
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00022.08
8.2.110.0030.00622.00
8.2.100.0090.00317.88
8.2.90.0060.00319.34
8.2.80.0060.00317.97
8.2.70.0050.00517.50
8.2.60.0000.00718.05
8.2.50.0030.00618.07
8.2.40.0030.00618.28
8.2.30.0000.00718.21
8.2.20.0030.00517.84
8.2.10.0040.00418.32
8.2.00.0040.00417.87
8.1.280.0070.00725.92
8.1.270.0060.00323.87
8.1.260.0020.00526.35
8.1.250.0000.00728.09
8.1.240.0090.00023.77
8.1.230.0040.00718.94
8.1.220.0000.00817.80
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0030.00617.47
8.1.180.0050.00218.10
8.1.170.0050.00818.39
8.1.160.0000.00721.97
8.1.150.0040.00418.91
8.1.140.0000.00717.60
8.1.130.0030.00317.94
8.1.120.0030.00517.54
8.1.110.0040.00417.49
8.1.100.0040.00417.68
8.1.90.0050.00217.63
8.1.80.0040.00417.61
8.1.70.0030.00317.57
8.1.60.0030.00617.75
8.1.50.0040.00417.55
8.1.40.0050.00317.67
8.1.30.0040.00417.80
8.1.20.0000.00717.78
8.1.10.0090.00017.69
8.1.00.0080.00017.58
8.0.300.0070.00018.77
8.0.290.0070.00016.88
8.0.280.0000.00718.53
8.0.270.0000.00817.04
8.0.260.0030.00317.39
8.0.250.0070.00017.16
8.0.240.0040.00417.16
8.0.230.0030.00417.08
8.0.220.0000.00717.11
8.0.210.0000.00717.08
8.0.200.0000.00717.15
8.0.190.0000.00717.18
8.0.180.0000.00717.12
8.0.170.0080.00017.14
8.0.160.0040.00417.17
8.0.150.0000.00716.94
8.0.140.0000.00816.96
8.0.130.0030.00313.42
8.0.120.0050.00317.11
8.0.110.0040.00417.07
8.0.100.0040.00417.09
8.0.90.0040.00417.14
8.0.80.0160.00017.13
8.0.70.0040.00417.16
8.0.60.0000.00716.94
8.0.50.0040.00417.08
8.0.30.0050.01817.25
8.0.20.0150.00817.55
8.0.10.0070.00017.03
8.0.00.0070.00917.07
7.4.330.0040.00415.02
7.4.320.0030.00316.65
7.4.300.0030.00316.58
7.4.290.0110.00016.68
7.4.280.0000.00816.74
7.4.270.0040.00416.67
7.4.260.0030.00316.76
7.4.250.0000.00716.57
7.4.240.0030.00316.73
7.4.230.0000.00716.65
7.4.220.0120.00616.86
7.4.210.0150.00616.84
7.4.200.0040.00416.49
7.4.160.0100.01516.53
7.4.150.0000.01717.40
7.4.140.0080.01017.86
7.4.130.0130.00616.74
7.4.120.0110.00616.61
7.4.110.0090.00916.71
7.4.100.0110.00616.67
7.4.90.0150.00316.82
7.4.80.0000.01819.39
7.4.70.0110.01516.70
7.4.60.0110.00416.64
7.4.50.0040.00416.51
7.4.40.0080.00816.70
7.4.30.0080.00816.83
7.4.00.0030.01415.34
7.3.330.0060.00013.47
7.3.320.0050.00013.48
7.3.310.0040.00416.59
7.3.300.0000.00716.47
7.3.290.0100.00716.52
7.3.280.0090.00716.49
7.3.270.0130.00417.40
7.3.260.0090.00916.81
7.3.250.0120.00516.65
7.3.240.0070.00916.58
7.3.230.0120.01116.62
7.3.210.0090.00916.54
7.3.200.0110.00719.39
7.3.190.0060.01616.56
7.3.180.0130.00316.59
7.3.170.0120.00416.68
7.3.160.0100.00616.72
7.2.330.0060.01216.90
7.2.320.0160.00316.90
7.2.310.0030.01716.57
7.2.300.0090.00916.90
7.2.290.0070.01116.88
7.2.60.0100.00316.74
7.2.00.0070.00719.59
7.1.200.0070.00716.09
7.1.100.0080.00417.97
7.1.70.0000.01117.29
7.1.60.0030.02019.32
7.1.50.0110.01417.11
7.1.00.0100.07022.31
7.0.200.0000.00717.09
7.0.140.0000.07722.08
7.0.60.0070.08019.93
7.0.50.0030.04017.88
7.0.40.0100.07320.09
7.0.30.0270.03720.30
7.0.20.0330.03720.07
7.0.10.0070.09020.30
7.0.00.0070.08720.18
5.6.280.0000.07721.07
5.6.210.0130.07020.56
5.6.200.0130.06318.18
5.6.190.0000.05320.41
5.6.180.0370.07020.61
5.6.170.0300.07020.47
5.6.160.0000.04720.55
5.6.150.0000.04318.19
5.6.140.0130.07718.18
5.6.130.0100.07018.23
5.6.120.0030.05320.99
5.6.110.0030.08320.90
5.6.100.0100.07320.97
5.6.90.0070.08021.05
5.6.80.0030.04020.45
5.6.70.4100.04020.38
5.5.350.0270.07720.45
5.5.340.0170.05717.98
5.5.330.0130.08020.47
5.5.320.0270.04020.52
5.5.310.0230.04320.27
5.5.300.0100.07717.98
5.5.290.0000.04317.99
5.5.280.0030.07320.78
5.5.270.0100.08020.87
5.5.260.0000.07020.81
5.5.250.0100.06020.60
5.5.240.0270.07020.20
5.4.450.0700.06719.49
5.4.440.1000.06019.61
5.4.430.0830.06719.16
5.4.420.0870.05319.47
5.4.410.0430.05019.48
5.4.400.0730.06719.14
5.4.390.0900.07019.01
5.4.380.0930.06719.21
5.4.370.0700.04719.13
5.4.360.0470.06719.15
5.4.350.0870.04719.38
5.4.340.0040.03612.02
5.4.320.0070.03512.51
5.4.310.0060.03712.51
5.4.300.0040.03812.51
5.4.290.0050.04312.51
5.4.280.0060.03812.41
5.4.270.0040.03712.41
5.4.260.0070.03612.41
5.4.250.0030.03912.41
5.4.240.0080.03612.40
5.4.230.0040.04312.39
5.4.220.0030.03712.40
5.4.210.0060.04712.39
5.4.200.0040.03912.40
5.4.190.0030.03812.40
5.4.180.0060.03612.39
5.4.170.0050.03712.40
5.4.160.0100.03512.40
5.4.150.0040.03812.39
5.4.140.0020.04112.07
5.4.130.0060.03512.07
5.4.120.0070.03412.03
5.4.110.0030.03812.02
5.4.100.0080.03412.02
5.4.90.0050.04112.02
5.4.80.0040.03912.02
5.4.70.0080.03212.02
5.4.60.0060.03412.02
5.4.50.0060.04012.02
5.4.40.0090.03812.00
5.4.30.0060.03512.00
5.4.20.0050.03512.00
5.4.10.0050.03512.00
5.4.00.0070.03411.48
5.3.290.0050.04012.80
5.3.280.0040.04212.71
5.3.270.0080.03912.72
5.3.260.0060.03812.72
5.3.250.0050.04512.71
5.3.240.0070.04112.72
5.3.230.0090.03512.71
5.3.220.0070.03612.68
5.3.210.0020.04212.68
5.3.200.0080.03412.68
5.3.190.0090.03512.67
5.3.180.0060.03612.67
5.3.170.0080.03412.67
5.3.160.0040.03812.68
5.3.150.0100.03312.68
5.3.140.0050.03812.66
5.3.130.0080.04012.66
5.3.120.0060.04312.66
5.3.110.0060.04512.66
5.3.100.0100.03312.13
5.3.90.0030.03912.11
5.3.80.0060.04812.10
5.3.70.0110.03212.11
5.3.60.0040.04012.09
5.3.50.0080.03412.03
5.3.40.0060.03612.04
5.3.30.0050.03411.99
5.3.20.0070.03911.77
5.3.10.0050.03511.74
5.3.00.0060.03611.73
5.2.170.0020.0329.24
5.2.160.0030.0309.24
5.2.150.0070.0289.23
5.2.140.0040.0319.23
5.2.130.0050.0309.19
5.2.120.0040.0319.20
5.2.110.0030.0319.20
5.2.100.0070.0279.19
5.2.90.0090.0249.19
5.2.80.0070.0339.19
5.2.70.0070.0319.19
5.2.60.0050.0299.14
5.2.50.0060.0279.11
5.2.40.0030.0339.09
5.2.30.0040.0309.07
5.2.20.0040.0299.05
5.2.10.0070.0258.96
5.2.00.0030.0338.83
5.1.60.0040.0308.10
5.1.50.0020.0278.10
5.1.40.0060.0228.08
5.1.30.0050.0258.43
5.1.20.0020.0288.45
5.1.10.0020.0278.17
5.1.00.0040.0258.17
5.0.50.0020.0226.66
5.0.40.0040.0196.53
5.0.30.0060.0296.33
5.0.20.0010.0246.30
5.0.10.0030.0226.29
5.0.00.0030.0326.28
4.4.90.0050.0184.78
4.4.80.0040.0154.76
4.4.70.0040.0144.75
4.4.60.0060.0144.76
4.4.50.0040.0174.77
4.4.40.0020.0274.71
4.4.30.0020.0164.76
4.4.20.0000.0194.84
4.4.10.0040.0164.85
4.4.00.0040.0254.76
4.3.110.0010.0174.67
4.3.100.0030.0154.66
4.3.90.0050.0124.63
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0020.0214.63
4.3.40.0030.0294.54
4.3.30.0010.0193.34
4.3.20.0010.0173.31
4.3.10.0020.0163.27
4.3.00.0170.0177.00

preferences:
60.12 ms | 401 KiB | 5 Q