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:00', '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.0060.01216.97
8.3.50.0140.00922.11
8.3.40.0090.00919.10
8.3.30.0030.01419.20
8.3.20.0070.01020.23
8.3.10.0070.00323.67
8.3.00.0030.00619.02
8.2.180.0070.01116.63
8.2.170.0130.01022.96
8.2.160.0070.01420.65
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00926.16
8.2.120.0050.00521.02
8.2.110.0070.00419.36
8.2.100.0090.00617.97
8.2.90.0070.00319.48
8.2.80.0080.00318.00
8.2.70.0060.00618.00
8.2.60.0070.00318.17
8.2.50.0030.00918.10
8.2.40.0030.00721.31
8.2.30.0070.00318.55
8.2.20.0030.00718.23
8.2.10.0000.01018.47
8.2.00.0080.00318.16
8.1.280.0060.01325.92
8.1.270.0040.00723.91
8.1.260.0030.00726.35
8.1.250.0000.01028.09
8.1.240.0080.00422.42
8.1.230.0160.00321.29
8.1.220.0090.00318.16
8.1.210.0000.01020.24
8.1.200.0090.00617.72
8.1.190.0040.00717.73
8.1.180.0070.00418.10
8.1.170.0030.00919.01
8.1.160.0000.01022.17
8.1.150.0000.01018.89
8.1.140.0040.00717.86
8.1.130.0030.00617.99
8.1.120.0000.01017.86
8.1.110.0030.00717.89
8.1.100.0030.00717.88
8.1.90.0030.00717.89
8.1.80.0030.00617.80
8.1.70.0030.00717.70
8.1.60.0070.00717.90
8.1.50.0090.00317.82
8.1.40.0100.00617.86
8.1.30.0090.00317.86
8.1.20.0090.00318.03
8.1.10.0040.00717.75
8.1.00.0070.00317.86
8.0.300.0030.00620.18
8.0.290.0030.00717.25
8.0.280.0030.00718.63
8.0.270.0040.00717.61
8.0.260.0030.00617.55
8.0.250.0000.00917.36
8.0.240.0000.01017.36
8.0.230.0000.01017.19
8.0.220.0030.00617.28
8.0.210.0000.00917.19
8.0.200.0000.01017.23
8.0.190.0000.01117.28
8.0.180.0030.00717.32
8.0.170.0070.00417.28
8.0.160.0030.00717.34
8.0.150.0000.01017.29
8.0.140.0000.01017.29
8.0.130.0080.00313.66
8.0.120.0000.01117.30
8.0.110.0040.00717.29
8.0.100.0030.00717.27
8.0.90.0030.00717.36
8.0.80.0090.01517.29
8.0.70.0000.01117.15
8.0.60.0070.00317.11
8.0.50.0000.01117.37
8.0.30.0170.00717.38
8.0.20.0090.01717.59
8.0.10.0030.00717.35
8.0.00.0110.01617.20
7.4.330.0040.00415.27
7.4.320.0000.00916.84
7.4.300.0030.00616.98
7.4.290.0070.00416.90
7.4.280.0030.01016.95
7.4.270.0050.00516.93
7.4.260.0060.00316.84
7.4.250.0000.01116.84
7.4.240.0050.00716.82
7.4.230.0030.00616.93
7.4.220.0060.01816.77
7.4.210.0080.01416.91
7.4.200.0030.00716.82
7.4.190.0050.00517.10
7.4.160.0090.01217.09
7.4.150.0090.01517.40
7.4.140.0080.01717.86
7.4.130.0080.01416.86
7.4.120.0050.01716.86
7.4.110.0060.01616.78
7.4.100.0060.01916.71
7.4.90.0070.01716.84
7.4.80.0120.01819.39
7.4.70.0060.01516.82
7.4.60.0110.01416.90
7.4.50.0030.00916.89
7.4.40.0070.01716.85
7.4.30.0100.02016.96
7.4.00.0000.02115.08
7.3.330.0040.00413.67
7.3.320.0000.00713.66
7.3.310.0030.00716.66
7.3.300.0030.00716.56
7.3.290.0120.00916.65
7.3.280.0080.01816.71
7.3.270.0070.01717.40
7.3.260.0120.00916.83
7.3.250.0080.02016.82
7.3.240.0100.01316.85
7.3.230.0030.02516.87
7.3.210.0120.01216.64
7.3.200.0160.00619.39
7.3.190.0040.01716.93
7.3.180.0110.01116.86
7.3.170.0080.01516.82
7.3.160.0100.01016.83
7.3.120.0030.02115.30
7.3.110.0030.01715.20
7.3.100.0160.00614.91
7.3.90.0030.01714.93
7.3.80.0060.01315.17
7.3.70.0060.01215.20
7.3.60.0040.01515.14
7.3.50.0060.01215.17
7.3.40.0110.01115.20
7.3.30.0030.01615.07
7.3.20.0090.00916.80
7.3.10.0060.01016.95
7.3.00.0100.01016.70
7.2.330.0040.02117.14
7.2.320.0130.01317.10
7.2.310.0110.01116.96
7.2.300.0090.01217.00
7.2.290.0130.01817.27
7.2.250.0040.01815.42
7.2.240.0070.02015.49
7.2.230.0090.01215.43
7.2.220.0030.02415.66
7.2.210.0060.01515.63
7.2.200.0030.01315.40
7.2.190.0070.01315.38
7.2.180.0030.01715.48
7.2.170.0070.01415.22
7.2.160.0030.01315.11
7.2.150.0040.01917.18
7.2.140.0130.00717.30
7.2.130.0130.00717.25
7.2.120.0130.01017.15
7.2.110.0030.01017.19
7.2.100.0000.01416.95
7.2.90.0070.00717.29
7.2.80.0100.01017.29
7.2.70.0000.01817.13
7.2.60.0070.01217.18
7.2.50.0060.01917.22
7.2.40.0070.01017.02
7.2.30.0110.00417.24
7.2.20.0090.01617.11
7.2.10.0090.01217.39
7.2.00.0050.01118.51
7.1.330.0090.00915.71
7.1.320.0130.01316.26
7.1.310.0030.00915.86
7.1.300.0060.01316.02
7.1.290.0000.02216.09
7.1.280.0100.01016.14
7.1.270.0060.01015.92
7.1.260.0090.00915.72
7.1.250.0100.01016.05
7.1.200.0070.00716.01
7.1.100.0070.01018.38
7.1.70.0030.01017.59
7.1.60.0180.01419.46
7.1.50.0000.01416.83
7.1.00.0070.08022.31
7.0.200.0000.01016.64
7.0.140.0070.07721.99
7.0.100.0470.07720.00
7.0.90.0470.06320.05
7.0.80.0070.10019.97
7.0.70.0170.06319.98
7.0.60.0100.07720.11
7.0.50.0100.08320.36
7.0.40.0130.05320.14
7.0.30.0170.08020.11
7.0.20.0070.04320.04
7.0.10.0000.06020.12
7.0.00.0030.08720.04
5.6.280.0030.08721.16
5.6.250.0100.04720.66
5.6.240.0130.05020.54
5.6.230.0030.09020.52
5.6.220.0130.06020.62
5.6.210.0030.05720.60
5.6.200.0170.06721.07
5.6.190.0100.09021.11
5.6.180.0030.06721.02
5.6.170.0030.06021.08
5.6.160.0130.05020.98
5.6.150.0030.09721.17
5.6.140.0030.05721.05
5.6.130.0030.06721.14
5.6.120.0130.08021.14
5.6.110.0130.08721.04
5.6.100.0070.10320.99
5.6.90.0070.10321.10
5.6.80.0100.07720.37
5.6.70.0170.08020.35
5.6.60.0070.05320.45
5.6.50.0130.07720.36
5.6.40.0030.09020.33
5.6.30.0070.09020.41
5.6.20.0070.08320.32
5.6.10.0030.08720.55
5.6.00.0130.04720.32
5.5.380.0170.09020.38
5.5.370.0130.07020.44
5.5.360.0100.09320.47
5.5.350.0070.09320.45
5.5.340.0100.05720.95
5.5.330.0070.07720.83
5.5.320.0100.09320.96
5.5.310.0100.06320.83
5.5.300.0100.08720.86
5.5.290.0000.05320.81
5.5.280.0130.06020.96
5.5.270.0030.08320.91
5.5.260.0030.07020.87
5.5.250.0070.09320.58
5.5.240.0100.08320.34
5.5.230.0070.05320.37
5.5.220.0070.09020.35
5.5.210.0070.08720.19
5.5.200.0030.05720.12
5.5.190.0030.06320.25
5.5.180.0170.06020.26
5.5.160.0170.07720.21
5.5.150.0030.07320.12
5.5.140.0130.08020.27
5.5.130.0070.06320.12
5.5.120.0070.05720.16
5.5.110.0100.05020.29
5.5.100.0100.04720.15
5.5.90.0100.06020.05
5.5.80.0100.07720.19
5.5.70.0070.05720.20
5.5.60.0170.05720.04
5.5.50.0130.08019.94
5.5.40.0170.04720.14
5.5.30.0070.06320.21
5.5.20.0130.07720.14
5.5.10.0000.10720.00
5.5.00.0000.09720.09
5.4.450.0030.05719.27
5.4.440.0130.08019.46
5.4.430.0030.08319.50
5.4.420.0130.06719.39
5.4.410.0070.05319.04
5.4.400.0070.05019.04
5.4.390.0000.07719.21
5.4.380.0030.08019.09
5.4.370.0130.08019.03
5.4.360.0030.05019.20
5.4.350.0030.08319.03
5.4.340.0070.08319.13
5.4.320.0100.09019.12
5.4.310.0000.09019.03
5.4.300.0070.06719.16
5.4.290.0100.08719.23
5.4.280.0130.07319.17
5.4.270.0200.07319.03
5.4.260.0030.05319.02
5.4.250.0000.08319.04
5.4.240.0100.08719.17
5.4.230.0070.07718.94
5.4.220.0100.08019.13
5.4.210.0170.08018.87
5.4.200.0070.05319.12
5.4.190.0100.07019.30
5.4.180.0100.08719.20
5.4.170.0130.07319.22
5.4.160.0100.08019.02
5.4.150.0200.06018.92
5.4.140.0170.04016.47
5.4.130.0100.04716.24
5.4.120.0070.07316.50
5.4.110.0170.04316.41
5.4.100.0030.09016.45
5.4.90.0030.08716.52
5.4.80.0030.08016.43
5.4.70.0000.08716.69
5.4.60.0070.08316.44
5.4.50.0070.08316.41
5.4.40.0070.06716.54
5.4.30.0130.08016.46
5.4.20.0070.08316.45
5.4.10.0100.07016.30
5.4.00.0170.04315.93
5.3.290.0100.09314.77
5.3.280.0000.05014.88
5.3.270.0100.07714.80
5.3.260.0070.08714.82
5.3.250.0070.09014.77
5.3.240.0070.08714.90
5.3.230.0030.08314.78
5.3.220.0070.08314.72
5.3.210.0130.08714.87
5.3.200.0130.08314.77
5.3.190.0070.08014.79
5.3.180.0100.04714.86
5.3.170.0070.06014.68
5.3.160.0030.06314.82
5.3.150.0100.07314.69
5.3.140.0170.07714.77
5.3.130.0100.08714.70
5.3.120.0030.05714.66
5.3.110.0030.04714.76
5.3.100.0000.08714.47
5.3.90.0030.05314.47
5.3.80.0070.07014.47
5.3.70.0070.05314.47
5.3.60.0000.09014.47
5.3.50.0130.08314.47
5.3.40.0130.06714.47
5.3.30.0030.08714.47
5.3.20.0070.05014.47
5.3.10.0100.04714.47
5.3.00.0000.05314.47
5.2.170.0100.06714.47
5.2.160.0070.04014.47
5.2.150.0030.07014.47
5.2.140.0000.07314.47
5.2.130.0030.07714.47
5.2.120.0070.06314.47
5.2.110.0070.07014.47
5.2.100.0170.06314.47
5.2.90.0030.07714.47
5.2.80.0030.06714.47
5.2.70.0030.08014.47
5.2.60.0000.08014.47
5.2.50.0030.08014.47
5.2.40.0100.07314.47
5.2.30.0070.07014.47
5.2.20.0130.05014.47
5.2.10.0030.07014.47
5.2.00.0070.07314.47
5.1.60.0130.05714.47
5.1.50.0070.06014.47
5.1.40.0030.05314.47
5.1.30.0000.04014.47
5.1.20.0130.05714.47
5.1.10.0070.06014.47
5.1.00.0000.04014.47
5.0.50.0100.05014.47
5.0.40.0100.04714.47
5.0.30.0100.04714.47
5.0.20.0170.03314.47
5.0.10.0070.02014.47
5.0.00.0100.07014.47
4.4.90.0100.03714.47
4.4.80.0030.02714.47
4.4.70.0100.04014.47
4.4.60.0070.04314.47
4.4.50.0100.03714.47
4.4.40.0130.05014.47
4.4.30.0170.02714.47
4.4.20.0030.02314.47
4.4.10.0100.03714.47
4.4.00.0100.05014.47
4.3.110.0070.02714.47
4.3.100.0030.03714.47
4.3.90.0070.01714.47
4.3.80.0100.05014.47
4.3.70.0030.03714.47
4.3.60.0000.04314.47
4.3.50.0130.01314.47
4.3.40.0100.06014.47
4.3.30.0130.03314.47
4.3.20.0100.03314.47
4.3.10.0030.02314.47
4.3.00.0200.02714.47

preferences:
46.49 ms | 401 KiB | 5 Q