3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add_deadline($givenDate, $hours){ $range = (ceil($hours/7)*120); $cnt=1; $goodhours = array(); foreach(range(1,$range) as $num): $datetime = date("Y-m-d H:i:s", strtotime('+'.$num.' hour',strtotime($givenDate))); $time = date("Hi", strtotime('+'.$num.' hour',strtotime($givenDate))); $day = date("D", strtotime('+'.$num.' hour', strtotime($givenDate))); if($day != 'Sat' && $day != 'Sun' && $time >= 830 && $time <= 1730): $goodhours[$cnt] = $datetime; if($cnt >= $hours && array_key_exists($hours,$goodhours)): return $goodhours[$hours]; break; endif; $cnt++; endif; endforeach; } //Pass in date and the hours to add on $future = add_deadline('2014-06-27 08:30', '65'); echo $future;

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.0120.00616.75
8.3.50.0170.01721.26
8.3.40.0060.01219.13
8.3.30.0040.01519.14
8.3.20.0040.00420.29
8.3.10.0060.00323.78
8.3.00.0030.00619.14
8.2.180.0070.02016.88
8.2.170.0100.00722.96
8.2.160.0000.01819.22
8.2.150.0050.00524.18
8.2.140.0060.00324.66
8.2.130.0030.00626.16
8.2.120.0090.00020.98
8.2.110.0050.00522.38
8.2.100.0070.00718.16
8.2.90.0000.01019.38
8.2.80.0000.01017.97
8.2.70.0000.01218.00
8.2.60.0060.00618.18
8.2.50.0000.01118.07
8.2.40.0000.01121.26
8.2.30.0000.01118.63
8.2.20.0000.01118.21
8.2.10.0070.00318.39
8.2.00.0000.01018.04
8.1.280.0070.01425.92
8.1.270.0080.00324.04
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0070.00424.03
8.1.230.0090.00619.33
8.1.220.0030.00718.04
8.1.210.0000.01118.77
8.1.200.0100.00517.72
8.1.190.0040.00717.75
8.1.180.0040.00818.10
8.1.170.0050.00518.96
8.1.160.0050.00522.18
8.1.150.0030.00819.02
8.1.140.0060.00617.73
8.1.130.0050.00518.13
8.1.120.0030.00717.84
8.1.110.0000.01017.80
8.1.100.0000.01017.87
8.1.90.0030.00717.86
8.1.80.0000.01017.76
8.1.70.0030.00617.82
8.1.60.0000.01317.79
8.1.50.0000.01117.77
8.1.40.0040.01217.75
8.1.30.0070.00417.95
8.1.20.0030.00817.88
8.1.10.0030.00717.85
8.1.00.0000.01117.91
8.0.300.0060.00318.77
8.0.290.0030.00717.13
8.0.280.0030.00618.63
8.0.270.0030.00917.46
8.0.260.0000.00917.52
8.0.250.0030.00617.21
8.0.240.0050.00517.32
8.0.230.0000.00917.18
8.0.220.0030.00617.30
8.0.210.0000.00917.16
8.0.200.0000.01117.38
8.0.190.0030.00717.21
8.0.180.0030.00717.33
8.0.170.0040.00717.32
8.0.160.0030.00717.19
8.0.150.0000.01017.19
8.0.140.0030.00717.12
8.0.130.0040.00413.54
8.0.120.0030.00817.28
8.0.110.0030.00717.16
8.0.100.0000.01117.27
8.0.90.0030.00717.27
8.0.80.0100.01017.34
8.0.70.0060.00617.28
8.0.60.0040.00717.20
8.0.50.0080.00317.39
8.0.30.0110.01217.46
8.0.20.0140.01417.68
8.0.10.0070.00317.45
8.0.00.0090.01417.00
7.4.330.0050.00215.15
7.4.320.0040.00416.80
7.4.300.0070.00316.93
7.4.290.0060.00316.91
7.4.280.0100.00516.90
7.4.270.0030.00716.90
7.4.260.0000.00916.77
7.4.250.0000.01116.89
7.4.240.0030.00616.81
7.4.230.0050.00516.63
7.4.220.0100.01516.91
7.4.210.0060.01816.91
7.4.200.0000.01016.82
7.4.190.0050.00517.01
7.4.160.0060.01316.88
7.4.150.0130.01017.40
7.4.140.0030.02017.86
7.4.130.0100.01416.79
7.4.120.0060.01616.88
7.4.110.0040.01916.89
7.4.100.0070.02116.98
7.4.90.0030.01816.88
7.4.80.0120.01219.39
7.4.70.0120.01316.88
7.4.60.0030.02016.78
7.4.50.0060.00616.63
7.4.40.0040.01816.69
7.4.30.0060.01516.55
7.4.00.0060.01215.40
7.3.330.0030.00613.45
7.3.320.0000.00713.73
7.3.310.0070.00316.76
7.3.300.0070.00316.68
7.3.290.0070.01316.61
7.3.280.0080.01816.69
7.3.270.0090.01317.40
7.3.260.0130.00916.94
7.3.250.0050.02217.00
7.3.240.0050.02116.67
7.3.230.0120.00916.81
7.3.210.0060.01616.71
7.3.200.0050.02319.39
7.3.190.0100.01316.80
7.3.180.0100.01616.79
7.3.170.0030.01816.96
7.3.160.0030.01616.92
7.3.120.0040.01415.37
7.3.10.0100.01016.87
7.3.00.0000.02116.69
7.2.330.0120.00916.85
7.2.320.0110.01116.86
7.2.310.0060.01617.16
7.2.300.0150.01517.13
7.2.290.0090.01916.86
7.2.130.0120.00417.08
7.2.120.0060.01216.99
7.2.110.0060.01317.01
7.2.100.0060.01317.33
7.2.90.0000.02317.39
7.2.80.0060.00917.05
7.2.70.0030.01716.86
7.2.60.0000.01517.17
7.2.50.0060.00617.36
7.2.40.0070.01317.23
7.2.30.0070.00817.25
7.2.20.0070.01317.19
7.2.10.0030.02317.17
7.2.00.0070.01418.26
7.1.250.0030.01716.19
7.1.200.0100.01015.99
7.1.100.0110.00418.33
7.1.70.0070.00317.59
7.1.60.0030.00917.30
7.1.50.0160.00917.30
7.1.00.0000.08722.56
7.0.200.0080.01616.70
7.0.140.0070.07322.18
7.0.100.0130.08020.13
7.0.90.0130.08020.03
7.0.80.0100.06020.02
7.0.70.0100.08320.04
7.0.60.0300.07320.01
7.0.50.0230.09020.36
7.0.40.0030.09320.09
7.0.30.0030.06020.05
7.0.20.0030.09320.09
7.0.10.0070.08320.14
7.0.00.0100.08720.08
5.6.280.0000.09020.96
5.6.250.0000.09320.72
5.6.240.0070.09020.63
5.6.230.0130.08320.63
5.6.220.0070.08020.73
5.6.210.0100.09020.68
5.6.200.0170.07321.17
5.6.190.0070.05321.17
5.6.180.0200.08021.14
5.6.170.0100.09021.14
5.6.160.0070.09320.99
5.6.150.0070.08020.97
5.6.140.0170.04021.13
5.6.130.0100.09021.09
5.6.120.0000.09721.11
5.6.110.0130.09020.98
5.6.100.0130.08321.04
5.6.90.0070.06321.05
5.6.80.0000.10020.37
5.6.70.0070.09720.48
5.6.60.0070.08720.54
5.6.50.0100.08020.52
5.6.40.0230.07320.50
5.6.30.0070.09720.50
5.6.20.0070.08720.38
5.6.10.0070.08720.39
5.6.00.0070.09720.34
5.5.380.0030.08720.54
5.5.370.0030.10020.49
5.5.360.0200.07720.37
5.5.350.0100.06020.50
5.5.340.0070.09020.83
5.5.330.0070.05720.95
5.5.320.0170.08720.80
5.5.310.0100.06320.79
5.5.300.0070.08720.64
5.5.290.0070.06020.91
5.5.280.0100.08020.79
5.5.270.0030.07720.80
5.5.260.0200.08720.86
5.5.250.0070.09020.59
5.5.240.0000.07020.07
5.5.230.0100.06720.21
5.5.220.0070.08020.20
5.5.210.0170.08320.29
5.5.200.0070.09020.26
5.5.190.0130.07020.18
5.5.180.0030.08320.12
5.5.160.0070.07020.31
5.5.150.0130.07720.26
5.5.140.0100.05320.18
5.5.130.0030.09320.22
5.5.120.0100.08020.11
5.5.110.0030.08020.34
5.5.100.0100.08320.14
5.5.90.0130.08719.97
5.5.80.0070.07020.25
5.5.70.0030.09020.09
5.5.60.0030.09320.09
5.5.50.0070.08320.10
5.5.40.0100.09720.09
5.5.30.0130.07720.06
5.5.20.0130.08019.96
5.5.10.0070.07720.27
5.5.00.0100.05020.13
5.4.450.0100.09019.19
5.4.440.0070.05319.49
5.4.430.0130.08319.46
5.4.420.0100.08319.55
5.4.410.0030.08719.43
5.4.400.0100.08019.19
5.4.390.0030.09318.90
5.4.380.0070.06319.21
5.4.370.0130.08019.21
5.4.360.0130.08319.05
5.4.350.0070.05719.04
5.4.340.0130.06719.09
5.4.320.0130.08019.19
5.4.310.0170.07719.03
5.4.300.0000.06319.22
5.4.290.0070.09718.87
5.4.280.0000.09319.16
5.4.270.0130.07719.04
5.4.260.0070.05019.25
5.4.250.0170.07019.16
5.4.240.0100.07318.84
5.4.230.0070.05318.84
5.4.220.0100.08319.23
5.4.210.0070.08719.04
5.4.200.0030.08719.13
5.4.190.0030.08318.89
5.4.180.0070.08319.07
5.4.170.0100.08719.04
5.4.160.0130.04718.86
5.4.150.0030.09018.86
5.4.140.0030.09016.46
5.4.130.0030.09316.32
5.4.120.0000.07016.42
5.4.110.0000.05016.32
5.4.100.0030.07316.60
5.4.90.0030.08316.45
5.4.80.0030.08716.43
5.4.70.0270.06716.50
5.4.60.0170.07316.52
5.4.50.0030.08716.45
5.4.40.0030.08716.54
5.4.30.0000.05716.29
5.4.20.0070.07316.46
5.4.10.0070.09016.37
5.4.00.0030.08715.88
5.3.290.0000.09714.84
5.3.280.0100.07014.89
5.3.270.0030.06014.91
5.3.260.0070.08314.89
5.3.250.0100.08314.89
5.3.240.0070.07014.81
5.3.230.0030.06314.82
5.3.220.0070.05014.81
5.3.210.0070.06714.79
5.3.200.0170.07714.73
5.3.190.0030.05014.85
5.3.180.0130.07714.81
5.3.170.0070.08014.80
5.3.160.0000.08314.89
5.3.150.0070.08714.73
5.3.140.0070.08714.75
5.3.130.0030.07714.72
5.3.120.0170.07714.88
5.3.110.0100.07714.88
5.3.100.0030.05314.72
5.3.90.0070.08014.72
5.3.80.0100.05714.72
5.3.70.0070.07314.72
5.3.60.0130.07014.72
5.3.50.0070.06714.72
5.3.40.0030.05314.72
5.3.30.0100.07714.72
5.3.20.0100.07714.72
5.3.10.0100.07314.72
5.3.00.0130.07314.72
5.2.170.0070.05714.72
5.2.160.0030.05714.72
5.2.150.0170.04014.72
5.2.140.0100.07314.72
5.2.130.0070.06714.72
5.2.120.0000.06014.72
5.2.110.0070.03314.72
5.2.100.0030.06714.72
5.2.90.0000.07314.72
5.2.80.0070.07014.72
5.2.70.0100.08314.72
5.2.60.0130.06714.72
5.2.50.0130.06014.72
5.2.40.0070.07714.72
5.2.30.0030.06714.72
5.2.20.0130.05714.72
5.2.10.0100.05314.72
5.2.00.0030.07314.72
5.1.60.0030.06714.72
5.1.50.0000.04714.72
5.1.40.0130.07714.72
5.1.30.0070.06714.72
5.1.20.0030.06714.72
5.1.10.0030.04014.72
5.1.00.0130.03014.72
5.0.50.0100.02714.72
5.0.40.0130.04714.72
5.0.30.0130.06314.72
5.0.20.0170.04014.72
5.0.10.0100.02714.72
5.0.00.0000.04014.72
4.4.90.0100.03714.72
4.4.80.0170.03014.72
4.4.70.0000.03314.72
4.4.60.0100.03314.72
4.4.50.0030.04314.72
4.4.40.0100.02714.72
4.4.30.0030.02714.72
4.4.20.0070.03714.72
4.4.10.0170.03014.72
4.4.00.0130.04714.72
4.3.110.0000.04014.72
4.3.100.0100.03714.72
4.3.90.0070.04014.72
4.3.80.0070.06314.72
4.3.70.0130.03714.72
4.3.60.0070.04014.72
4.3.50.0030.04014.72
4.3.40.0100.05314.72
4.3.30.0070.03714.72
4.3.20.0000.04014.72
4.3.10.0070.03014.72
4.3.00.0030.02714.72

preferences:
50.23 ms | 401 KiB | 5 Q