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:15'); $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.60.0130.00718.80
8.3.50.0130.00622.10
8.3.40.0150.00018.84
8.3.30.0140.00319.09
8.3.20.0070.00020.16
8.3.10.0080.00023.56
8.3.00.0040.00419.63
8.2.180.0090.00617.00
8.2.170.0140.00722.96
8.2.160.0070.00720.29
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00422.14
8.2.110.0070.00322.24
8.2.100.0040.00817.88
8.2.90.0040.00419.27
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0030.00618.05
8.2.50.0000.00818.07
8.2.40.0040.00418.28
8.2.30.0050.00318.11
8.2.20.0050.00317.95
8.2.10.0070.00018.19
8.2.00.0060.00317.76
8.1.280.0030.01225.92
8.1.270.0120.00323.68
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00624.03
8.1.230.0080.00318.97
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0080.00017.38
8.1.180.0030.00618.10
8.1.170.0070.00318.64
8.1.160.0070.00021.88
8.1.150.0050.00218.79
8.1.140.0070.00017.50
8.1.130.0030.00317.88
8.1.120.0070.00017.66
8.1.110.0080.00017.50
8.1.100.0020.00517.66
8.1.90.0070.00017.58
8.1.80.0040.00417.63
8.1.70.0000.00717.52
8.1.60.0030.00617.60
8.1.50.0030.00617.57
8.1.40.0060.00317.68
8.1.30.0040.00417.63
8.1.20.0040.00417.75
8.1.10.0040.00417.68
8.1.00.0000.00817.64
8.0.300.0040.00418.77
8.0.290.0080.00016.88
8.0.280.0080.00018.57
8.0.270.0070.00017.41
8.0.260.0030.00317.32
8.0.250.0040.00417.14
8.0.240.0040.00417.18
8.0.230.0000.00717.16
8.0.220.0040.00417.09
8.0.210.0030.00317.10
8.0.200.0030.00317.10
8.0.190.0030.00517.06
8.0.180.0040.00417.13
8.0.170.0000.00817.02
8.0.160.0000.00717.18
8.0.150.0040.00417.05
8.0.140.0000.00817.12
8.0.130.0000.00613.46
8.0.120.0000.00816.97
8.0.110.0020.00517.18
8.0.100.0040.00416.88
8.0.90.0040.00416.93
8.0.80.0100.01017.11
8.0.70.0050.00216.94
8.0.60.0000.00917.09
8.0.50.0030.00516.98
8.0.30.0130.01117.27
8.0.20.0120.00917.40
8.0.10.0030.00617.34
8.0.00.0120.00516.97
7.4.330.0000.00615.02
7.4.320.0030.00316.64
7.4.300.0000.00616.75
7.4.290.0060.00316.77
7.4.280.0080.00016.65
7.4.270.0020.00516.73
7.4.260.0000.00716.63
7.4.250.0040.00416.69
7.4.240.0060.00216.75
7.4.230.0030.00316.56
7.4.220.0060.01216.79
7.4.210.0060.00916.78
7.4.200.0040.00416.78
7.4.160.0150.00716.77
7.4.150.0000.01817.40
7.4.140.0090.01017.86
7.4.130.0090.01116.80
7.4.120.0070.01016.78
7.4.110.0060.01316.93
7.4.100.0090.00816.70
7.4.90.0070.01016.80
7.4.80.0060.01119.39
7.4.70.0150.00316.56
7.4.60.0090.00616.68
7.4.50.0050.00016.64
7.4.40.0130.00316.62
7.4.30.0160.00016.79
7.4.00.0130.00314.83
7.3.330.0000.00613.50
7.3.320.0030.00313.34
7.3.310.0040.00416.54
7.3.300.0060.00016.46
7.3.290.0060.00916.49
7.3.280.0090.00916.51
7.3.270.0180.00017.40
7.3.260.0030.01316.75
7.3.250.0040.01216.75
7.3.240.0100.00716.77
7.3.230.0140.00716.50
7.3.210.0030.01316.61
7.3.200.0120.00319.39
7.3.190.0180.00316.48
7.3.180.0100.00616.44
7.3.170.0050.01116.71
7.3.160.0050.01116.79
7.3.10.0110.00716.65
7.3.00.0080.00416.70
7.2.330.0070.01316.71
7.2.320.0090.00916.98
7.2.310.0030.01616.70
7.2.300.0080.00816.69
7.2.290.0030.01316.61
7.2.130.0110.00517.11
7.2.120.0100.00716.77
7.2.110.0040.01216.67
7.2.100.0150.00316.91
7.2.90.0120.00816.95
7.2.80.0090.00816.87
7.2.70.0070.01317.13
7.2.60.0120.00616.91
7.2.50.0110.00716.93
7.2.40.0120.01216.80
7.2.30.0040.01316.72
7.2.20.0100.00316.70
7.2.10.0130.01016.74
7.2.00.0060.01018.38
7.1.250.0020.01015.71
7.1.200.0040.01116.11
7.1.100.0070.00718.40
7.1.70.0070.00717.28
7.1.60.0110.01519.32
7.1.50.0030.02117.30
7.1.00.0100.07022.49
7.0.200.0110.00417.14
7.0.140.0030.07322.15
7.0.60.0070.05020.05
7.0.50.0130.07317.96
7.0.40.0130.04320.13
7.0.30.0200.04720.30
7.0.20.0270.07020.21
7.0.10.0030.08320.07
7.0.00.0000.08320.23
5.6.280.0000.07721.14
5.6.210.0100.07320.68
5.6.200.0070.04318.16
5.6.190.0170.07720.39
5.6.180.3370.05020.47
5.6.170.0230.07720.48
5.6.160.0170.08020.61
5.6.150.0170.07018.18
5.6.140.0070.04718.18
5.6.130.0070.06718.23
5.6.120.0070.08720.96
5.6.110.0070.09021.10
5.6.100.0100.05721.05
5.6.90.0100.05720.99
5.6.80.0000.08720.52
5.6.70.3700.03720.29
5.5.350.0170.06020.34
5.5.340.0030.08318.09
5.5.330.0070.04320.46
5.5.320.3470.04320.51
5.5.310.0370.07020.35
5.5.300.0070.08018.08
5.5.290.0100.07717.99
5.5.280.0030.04320.75
5.5.270.0130.08020.85
5.5.260.0070.06720.90
5.5.250.0070.07720.71
5.5.240.0200.07020.27
5.4.450.0870.05719.61
5.4.440.0770.06319.61
5.4.430.1000.05019.46
5.4.420.0930.05319.45
5.4.410.0830.06019.34
5.4.400.0200.04319.29
5.4.390.0770.06019.21
5.4.380.0670.05318.84
5.4.370.1130.05719.25
5.4.360.0230.05719.14
5.4.350.0770.05718.98
5.4.340.0030.03812.02
5.4.320.0030.04012.51
5.4.310.0090.04012.51
5.4.300.0050.03712.52
5.4.290.0070.03712.51
5.4.280.0090.03212.41
5.4.270.0070.03412.41
5.4.260.0080.04512.41
5.4.250.0060.04212.41
5.4.240.0060.03512.41
5.4.230.0070.03612.40
5.4.220.0070.04112.40
5.4.210.0050.03612.40
5.4.200.0080.04212.40
5.4.190.0030.03912.39
5.4.180.0070.04212.39
5.4.170.0090.03212.41
5.4.160.0060.03512.39
5.4.150.0040.03812.39
5.4.140.0050.04212.08
5.4.130.0070.03612.06
5.4.120.0100.04412.02
5.4.110.0060.03812.02
5.4.100.0070.04212.02
5.4.90.0060.04312.02
5.4.80.0070.03812.02
5.4.70.0050.03612.02
5.4.60.0070.03412.02
5.4.50.0070.03712.02
5.4.40.0040.03712.01
5.4.30.0070.03412.00
5.4.20.0060.04012.00
5.4.10.0050.03512.00
5.4.00.0040.03711.49
5.3.290.0100.03912.80
5.3.280.0050.03712.71
5.3.270.0060.03812.73
5.3.260.0090.04012.72
5.3.250.0080.03412.72
5.3.240.0060.03512.72
5.3.230.0050.03912.71
5.3.220.0080.03512.68
5.3.210.0080.04512.68
5.3.200.0060.03912.68
5.3.190.0100.03512.68
5.3.180.0130.03212.67
5.3.170.0080.03812.67
5.3.160.0090.03412.68
5.3.150.0050.04112.68
5.3.140.0070.03712.66
5.3.130.0040.04012.66
5.3.120.0050.04012.66
5.3.110.0080.03612.66
5.3.100.0040.03812.14
5.3.90.0070.03512.11
5.3.80.0080.04312.11
5.3.70.0090.03312.11
5.3.60.0060.03812.09
5.3.50.0030.03912.04
5.3.40.0050.03812.04
5.3.30.0060.03312.00
5.3.20.0080.04711.78
5.3.10.0110.03311.74
5.3.00.0040.04411.73
5.2.170.0050.0299.24
5.2.160.0030.0319.24
5.2.150.0010.0339.24
5.2.140.0030.0319.23
5.2.130.0050.0289.20
5.2.120.0030.0309.20
5.2.110.0050.0299.21
5.2.100.0050.0289.19
5.2.90.0080.0269.19
5.2.80.0060.0299.19
5.2.70.0040.0319.20
5.2.60.0040.0339.14
5.2.50.0050.0329.12
5.2.40.0040.0309.09
5.2.30.0060.0299.07
5.2.20.0050.0289.05
5.2.10.0050.0378.98
5.2.00.0020.0318.84
5.1.60.0040.0258.12
5.1.50.0060.0258.11
5.1.40.0040.0278.10
5.1.30.0050.0288.45
5.1.20.0050.0298.47
5.1.10.0040.0288.20
5.1.00.0070.0278.19
5.0.50.0040.0236.68
5.0.40.0060.0276.54
5.0.30.0020.0426.36
5.0.20.0030.0196.32
5.0.10.0030.0276.30
5.0.00.0050.0376.30
4.4.90.0050.0134.78
4.4.80.0020.0164.76
4.4.70.0040.0144.75
4.4.60.0020.0184.75
4.4.50.0040.0184.77
4.4.40.0030.0244.71
4.4.30.0040.0214.76
4.4.20.0020.0214.84
4.4.10.0040.0144.85
4.4.00.0030.0304.76
4.3.110.0030.0204.67
4.3.100.0010.0174.66
4.3.90.0040.0144.64
4.3.80.0030.0244.59
4.3.70.0020.0154.63
4.3.60.0020.0154.62
4.3.50.0050.0184.63
4.3.40.0030.0254.55
4.3.30.0020.0153.36
4.3.20.0010.0163.34
4.3.10.0010.0163.29
4.3.00.0170.0176.81

preferences:
39.71 ms | 401 KiB | 5 Q