3v4l.org

run code in 300+ PHP versions simultaneously
<?php $beginday=date('Y-m-01'); $lastday=date('Y-m-t'); $nr_work_days = getWorkingDays($beginday,$lastday); echo $nr_work_days; function getWorkingDays($startDate, $endDate){ $begin=strtotime($startDate); $end=strtotime($endDate); if($begin>$end){ echo "startdate is in the future! <br>"; return 0; }else{ $working_days=0; $total_days=0; while($begin<=$end){ $what_day=date("N",$begin); $total_days++; if($what_day<=5) { // 6 and 7 are weekend days $working_days++; }; $begin+=86400; // +1 day }; $testString = "hours to subtract: " . ($working_days * 8) + (($total_days - $working_days)*24); return $testString; } } ?>

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.0150.00618.55
8.3.50.0100.00722.08
8.3.40.0110.00419.14
8.3.30.0140.00719.27
8.3.20.0000.00720.35
8.3.10.0070.00021.73
8.3.00.0070.00319.50
8.2.180.0070.01116.63
8.2.170.0070.00722.96
8.2.160.0130.00020.39
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0020.00526.16
8.2.120.0040.00422.10
8.2.110.0060.00321.04
8.2.100.0120.00018.03
8.2.90.0050.00519.03
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0060.00318.03
8.2.50.0060.00318.10
8.2.40.0070.00318.22
8.2.30.0060.00318.25
8.2.20.0090.00017.86
8.2.10.0040.00418.26
8.2.00.0080.00017.82
8.1.280.0100.00725.92
8.1.270.0110.00422.06
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.06
8.1.230.0030.01317.83
8.1.220.0060.00317.77
8.1.210.0040.00418.77
8.1.200.0070.00417.50
8.1.190.0060.00317.38
8.1.180.0060.00318.10
8.1.170.0030.00618.63
8.1.160.0050.00321.98
8.1.150.0000.00719.02
8.1.140.0000.00717.59
8.1.130.0030.00317.92
8.1.120.0040.00417.68
8.1.110.0030.00517.55
8.1.100.0000.00717.55
8.1.90.0000.00817.70
8.1.80.0000.00717.64
8.1.70.0000.00717.64
8.1.60.0000.00817.59
8.1.50.0000.00817.71
8.1.40.0030.00517.57
8.1.30.0030.00617.69
8.1.20.0030.00617.71
8.1.10.0000.00817.65
8.1.00.0100.00017.64
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0030.00318.52
8.0.270.0040.00417.34
8.0.260.0030.00317.21
8.0.250.0030.00517.04
8.0.240.0030.00317.13
8.0.230.0040.00417.13
8.0.220.0000.00717.16
8.0.210.0000.00817.08
8.0.200.0000.00717.16
8.0.190.0050.00317.16
8.0.180.0050.00317.17
8.0.170.0000.00817.11
8.0.160.0030.00416.96
8.0.150.0030.00516.90
8.0.140.0000.00717.09
8.0.130.0000.00613.45
8.0.120.0030.00617.05
8.0.110.0000.00817.15
8.0.100.0040.00416.91
8.0.90.0050.00217.09
8.0.80.0090.00617.04
8.0.70.0000.00716.88
8.0.60.0000.00717.05
8.0.50.0070.00017.14
8.0.30.0110.01117.33
8.0.20.0140.00817.42
8.0.10.0040.00417.04
8.0.00.0090.00916.98
7.4.330.0020.00215.00
7.4.320.0030.00316.66
7.4.300.0040.00416.74
7.4.290.0030.00316.66
7.4.280.0070.00316.77
7.4.270.0030.00316.57
7.4.260.0000.00716.61
7.4.250.0040.00416.65
7.4.240.0000.00716.65
7.4.230.0000.00716.54
7.4.220.0110.00716.69
7.4.210.0090.00416.65
7.4.200.0000.00716.63
7.4.160.0070.00716.69
7.4.150.0090.00917.40
7.4.140.0060.01317.86
7.4.130.0130.00716.76
7.4.120.0100.00616.73
7.4.110.0100.00716.72
7.4.100.0120.01016.66
7.4.90.0130.00716.71
7.4.80.0130.00919.39
7.4.70.0030.01316.70
7.4.60.0160.00716.64
7.4.50.0090.00016.57
7.4.40.0060.01816.78
7.4.30.0100.00616.95
7.4.00.0040.01314.87
7.3.330.0030.00313.45
7.3.320.0000.00513.49
7.3.310.0030.00316.59
7.3.300.0030.00316.54
7.3.290.0090.00616.45
7.3.280.0080.01016.52
7.3.270.0120.00617.40
7.3.260.0070.01116.79
7.3.250.0140.00316.76
7.3.240.0100.01316.62
7.3.230.0070.01016.67
7.3.210.0070.01016.54
7.3.200.0030.01519.39
7.3.190.0120.00416.72
7.3.180.0090.01016.54
7.3.170.0030.01316.66
7.3.160.0100.00616.68
7.3.120.0120.00715.08
7.3.110.0100.00814.87
7.3.100.0090.00514.97
7.3.90.0090.00515.21
7.3.80.0050.01015.05
7.3.70.0100.00415.03
7.3.60.0090.00514.99
7.3.50.0090.00514.98
7.3.40.0060.00614.97
7.3.30.0070.00815.07
7.3.20.0120.00516.77
7.3.10.0060.00716.67
7.3.00.0030.01216.95
7.2.330.0100.00717.00
7.2.320.0060.01016.86
7.2.310.0320.02216.80
7.2.300.0160.00016.76
7.2.290.0090.01216.62
7.2.250.0080.01115.31
7.2.240.0080.01215.43
7.2.230.0100.00715.25
7.2.220.0020.00915.12
7.2.210.0060.01015.19
7.2.200.0050.00515.03
7.2.190.0020.01215.23
7.2.180.0020.01115.27
7.2.170.0080.00915.13
7.2.60.0040.01117.04
7.1.330.0050.00715.93
7.1.320.0030.01015.86
7.1.310.0020.01015.94
7.1.300.0020.01115.89
7.1.290.0050.00915.75
7.1.280.0050.00915.81
7.1.270.0030.00816.01
7.1.260.0040.00915.77
7.1.200.0040.00815.98
7.1.100.1110.01017.76
7.1.70.0050.00317.35
7.1.60.0160.00919.32
7.1.50.0070.01717.21
7.1.00.0070.07322.57
7.0.200.0030.00616.82
7.0.140.0070.07021.93
7.0.80.0000.08319.89
7.0.70.0070.08319.93
7.0.60.0030.09019.98
7.0.50.0100.05720.37
7.0.40.0200.05320.14
7.0.30.0000.05020.07
7.0.20.0070.08320.17
7.0.10.0100.04320.04
7.0.00.0030.06720.14
5.6.280.0070.07021.16
5.6.230.0030.06720.51
5.6.220.0100.06720.58
5.6.210.0030.06020.65
5.6.200.0070.08021.04
5.6.190.0100.08320.93
5.6.180.0170.04721.10
5.6.170.0030.05721.04
5.6.160.0200.06721.12
5.6.150.0100.07721.09
5.6.140.0070.04321.02
5.6.130.0100.07021.17
5.6.120.0200.04021.05
5.6.110.0030.05321.01
5.6.100.0030.04721.05
5.6.90.0100.04021.06
5.6.80.0100.07320.34
5.6.70.0130.03320.35
5.6.60.0170.07020.43
5.6.50.0130.06320.50
5.6.40.0030.04320.31
5.6.30.0100.06720.38
5.6.20.0030.04320.36
5.6.10.0030.08320.43
5.6.00.0100.05320.34
5.5.370.0000.05720.55
5.5.360.0070.08020.49
5.5.350.0000.05320.46
5.5.340.0030.08020.91
5.5.330.0130.07720.74
5.5.320.0130.07020.93
5.5.310.0130.05720.92
5.5.300.0100.05020.91
5.5.290.0130.05720.80
5.5.280.0030.05320.80
5.5.270.0030.05020.72
5.5.260.0030.05020.84
5.5.250.0070.05020.75
5.5.240.0100.08020.03
5.5.230.0070.08320.23
5.5.220.0070.06020.14
5.5.210.0270.06020.19
5.5.200.0170.02720.16
5.5.190.0070.05720.23
5.5.180.0000.04720.23
5.5.160.0100.08320.13
5.5.150.0030.04020.12
5.5.140.0070.04320.12
5.5.130.0030.04020.25
5.5.120.0000.04320.13
5.5.110.0070.03720.21
5.5.100.0000.04320.07
5.5.90.0030.04320.10
5.5.80.0070.03720.06
5.5.70.0030.04720.07
5.5.60.0030.03720.06
5.5.50.0000.06320.16
5.5.40.0130.07319.96
5.5.30.0100.03320.10
5.5.20.0100.07320.06
5.5.10.0030.04720.02
5.5.00.0030.04020.08
5.4.450.0000.05719.18
5.4.440.0100.07719.44
5.4.430.0000.04719.35
5.4.420.0070.04319.36
5.4.410.0030.04319.25
5.4.400.0070.06719.21
5.4.390.0130.07019.05
5.4.380.0170.06319.14
5.4.370.0070.04019.03
5.4.360.0000.04319.03
5.4.350.0070.04318.87
5.4.340.0000.04319.03
5.4.320.0100.07318.91
5.4.310.0000.04319.12
5.4.300.0000.06019.12
5.4.290.0100.02718.87
5.4.280.0070.06018.87
5.4.270.0000.03718.94
5.4.260.0000.04019.02
5.4.250.0000.04019.01
5.4.240.0030.04319.18
5.4.230.0100.03019.12
5.4.220.0030.03719.12
5.4.210.0100.03318.88
5.4.200.0030.05319.20
5.4.190.0070.07019.13
5.4.180.0100.07018.87
5.4.170.0000.04019.02
5.4.160.0100.02719.22
5.4.150.0000.04018.88
5.4.140.0030.03716.44
5.4.130.0030.03316.21
5.4.120.0000.04016.33
5.4.110.0030.03716.48
5.4.100.0070.03016.50
5.4.90.0070.03016.27
5.4.80.0030.03316.50
5.4.70.0070.03016.33
5.4.60.0000.03716.41
5.4.50.0030.02716.40
5.4.40.0000.03316.49
5.4.30.0000.03316.47
5.4.20.0030.03316.29
5.4.10.0000.04016.45
5.4.00.0030.03315.96
5.3.290.0000.07014.76
5.3.280.0030.04314.70
5.3.270.0070.04314.54
5.3.260.0000.04014.57
5.3.250.0030.03714.53
5.3.240.0100.02714.67
5.3.230.0030.04714.57
5.3.220.0100.02714.70
5.3.210.0100.03014.67
5.3.200.0030.06714.59
5.3.190.0030.03714.58
5.3.180.0000.04014.57
5.3.170.0000.03314.58
5.3.160.0000.03314.52
5.3.150.0000.04014.67
5.3.140.0000.04014.48
5.3.130.0030.03014.64
5.3.120.0000.04014.57
5.3.110.0000.04014.52
5.3.100.0070.03014.16
5.3.90.0000.03713.96
5.3.80.0000.05014.14
5.3.70.0070.03314.14
5.3.60.0000.04013.89
5.3.50.0030.04014.07
5.3.40.0030.07714.06
5.3.30.0000.03713.91
5.3.20.0070.03013.62
5.3.10.0000.03713.58
5.3.00.0030.03713.54
5.2.170.0000.02711.20
5.2.160.0000.06711.17
5.2.150.0000.02711.13
5.2.140.0030.04011.23
5.2.130.0030.02311.21
5.2.120.0030.03711.19
5.2.110.0000.03311.11
5.2.100.0070.04711.10
5.2.90.0070.02011.00
5.2.80.0000.02711.00
5.2.70.0030.02711.14
5.2.60.0070.03310.93
5.2.50.0030.03011.10
5.2.40.0030.03311.02
5.2.30.0100.05710.89
5.2.20.0070.03011.04
5.2.10.0030.06310.72
5.2.00.0070.05710.63
5.1.60.0100.04710.00
5.1.50.0000.0409.98
5.1.40.0030.03310.04
5.1.30.0030.03010.33
5.1.20.0070.02710.41
5.1.10.0030.03010.13
5.1.00.0070.02710.18
5.0.50.0030.0478.39
5.0.40.0070.0408.46
5.0.30.0030.0338.07
5.0.20.0100.0338.19
5.0.10.0070.0438.13
5.0.00.0070.0338.01
4.4.90.0000.0177.36
4.4.80.0030.0137.36
4.4.70.0070.0307.36
4.4.60.0030.0307.36
4.4.50.0000.0307.36
4.4.40.0030.0537.36
4.4.30.0000.0237.36
4.4.20.0000.0277.36
4.4.10.0030.0137.36
4.4.00.0030.0507.36
4.3.110.0000.0237.36
4.3.100.0030.0307.36
4.3.90.0070.0207.36
4.3.80.0000.0377.36
4.3.70.0030.0177.36
4.3.60.0030.0237.36
4.3.50.0000.0407.36
4.3.40.0000.0537.36
4.3.30.0030.0337.36
4.3.20.0000.0337.36
4.3.10.0030.0307.36
4.3.00.0000.0337.36

preferences:
59.2 ms | 401 KiB | 5 Q