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{ $no_days=0; $weekends=0; while($begin<=$end){ $no_days++; // no of days in the given interval $what_day=date("N",$begin); if($what_day>5) { // 6 and 7 are weekend days $weekends++; }; $begin+=86400; // +1 day }; $working_days=$no_days-$weekends; return $working_days; } }

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.0090.00618.43
8.3.50.0140.01021.17
8.3.40.0120.00918.76
8.3.30.0060.00919.05
8.3.20.0040.00420.27
8.3.10.0040.00423.50
8.3.00.0030.00619.51
8.2.180.0140.00616.63
8.2.170.0140.00722.96
8.2.160.0100.00320.41
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00226.16
8.2.120.0000.00822.25
8.2.110.0000.00922.02
8.2.100.0080.00417.75
8.2.90.0000.00819.40
8.2.80.0030.00617.97
8.2.70.0060.00317.88
8.2.60.0040.00718.05
8.2.50.0000.00918.07
8.2.40.0070.00418.09
8.2.30.0100.00018.19
8.2.20.0040.00417.93
8.2.10.0070.00018.10
8.2.00.0080.00017.99
8.1.280.0070.01325.92
8.1.270.0030.00622.05
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0040.00818.97
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0050.00517.48
8.1.190.0080.00017.48
8.1.180.0040.00418.10
8.1.170.0060.00318.84
8.1.160.0000.00822.01
8.1.150.0070.00018.89
8.1.140.0000.00817.61
8.1.130.0030.00317.89
8.1.120.0070.00017.52
8.1.110.0030.00517.54
8.1.100.0000.00817.61
8.1.90.0000.00817.61
8.1.80.0030.00317.56
8.1.70.0040.00417.59
8.1.60.0040.00417.71
8.1.50.0050.00317.63
8.1.40.0000.00717.63
8.1.30.0000.00817.68
8.1.20.0000.00817.82
8.1.10.0040.00417.49
8.1.00.0000.00817.66
8.0.300.0030.00618.77
8.0.290.0030.00616.88
8.0.280.0000.00718.52
8.0.270.0070.00017.29
8.0.260.0000.00617.37
8.0.250.0030.00317.14
8.0.240.0000.00617.15
8.0.230.0000.00717.15
8.0.220.0030.00317.10
8.0.210.0000.00717.19
8.0.200.0000.00717.22
8.0.190.0000.00817.08
8.0.180.0000.00716.97
8.0.170.0030.00517.12
8.0.160.0000.00717.14
8.0.150.0030.00416.94
8.0.140.0000.00717.00
8.0.130.0030.00313.43
8.0.120.0040.00417.05
8.0.110.0080.00017.09
8.0.100.0030.00317.11
8.0.90.0040.00416.98
8.0.80.0060.00917.03
8.0.70.0040.00416.91
8.0.60.0040.00416.93
8.0.50.0000.00717.09
8.0.30.0100.00917.17
8.0.20.0110.01217.42
8.0.10.0030.00517.21
8.0.00.0080.01016.90
7.4.330.0030.00315.06
7.4.320.0000.00716.72
7.4.300.0000.00716.79
7.4.290.0080.00016.65
7.4.280.0070.00216.73
7.4.270.0030.00316.71
7.4.260.0070.00416.71
7.4.250.0050.00216.70
7.4.240.0010.00716.70
7.4.230.0070.00016.85
7.4.220.0030.01516.71
7.4.210.0050.01016.77
7.4.200.0000.00816.54
7.4.160.0060.00916.63
7.4.150.0130.00917.40
7.4.140.0120.00917.86
7.4.130.0100.00716.66
7.4.120.0120.00616.68
7.4.110.0090.01516.64
7.4.100.0090.01416.82
7.4.90.0090.01316.72
7.4.80.0030.01319.39
7.4.70.0110.01116.43
7.4.60.0120.00616.61
7.4.50.0030.00316.63
7.4.40.0120.00916.75
7.4.30.0090.01216.63
7.4.00.0130.00314.97
7.3.330.0030.00313.42
7.3.320.0060.00013.17
7.3.310.0030.00316.52
7.3.300.0000.00716.48
7.3.290.0040.01116.42
7.3.280.0100.00616.41
7.3.270.0140.00517.40
7.3.260.0060.01216.77
7.3.250.0110.00816.79
7.3.240.0110.00716.63
7.3.230.0060.01016.63
7.3.210.0130.00316.82
7.3.200.0160.00619.39
7.3.190.0070.01016.63
7.3.180.0100.00616.78
7.3.170.0030.01316.64
7.3.160.0160.00316.63
7.3.120.0070.01014.73
7.3.110.0070.01115.18
7.3.100.0100.00714.84
7.3.90.0070.01114.87
7.3.80.0090.00914.78
7.3.70.0110.00415.01
7.3.60.0040.00815.00
7.3.50.0000.01414.87
7.3.40.0110.00314.83
7.3.30.0060.00914.84
7.3.20.0040.01116.77
7.3.10.0000.01316.64
7.3.00.0080.00416.91
7.2.330.0100.00716.98
7.2.320.0100.00716.90
7.2.310.0030.01316.77
7.2.300.0110.00616.91
7.2.290.0160.00616.87
7.2.250.0030.01415.43
7.2.240.0060.01015.35
7.2.230.0060.00615.11
7.2.220.0070.00715.11
7.2.210.0060.00615.35
7.2.200.0090.00415.25
7.2.190.0120.00315.20
7.2.180.0030.01315.20
7.2.170.0080.00815.11
7.2.00.0040.01219.34
7.1.330.0150.00016.14
7.1.320.0030.01315.93
7.1.310.0060.01315.74
7.1.300.0030.00915.88
7.1.290.0030.00615.93
7.1.280.0030.01015.73
7.1.270.0090.00615.61
7.1.260.0150.00016.00
7.1.200.0120.00016.11
7.1.100.0060.00618.33
7.1.70.0000.00817.41
7.1.60.0070.01719.32
7.1.50.0040.01817.00
7.1.00.0070.06722.28
7.0.200.0000.00716.74
7.0.140.0000.07722.12
7.0.100.0070.08019.85
7.0.90.0170.06719.96
7.0.80.0030.04319.87
7.0.70.0070.08719.99
7.0.60.0100.04020.05
7.0.50.0130.08020.31
7.0.40.0070.08320.14
7.0.30.0130.07720.03
7.0.20.0030.03720.12
7.0.10.0100.08020.03
7.0.00.0130.03320.13
5.6.280.0030.07320.82
5.6.250.0100.08020.66
5.6.240.0070.09020.67
5.6.230.0170.03020.51
5.6.220.0030.08020.61
5.6.210.0100.05020.65
5.6.200.0070.05020.99
5.6.190.0170.07720.93
5.6.180.0070.08320.98
5.6.170.0100.07721.11
5.6.160.0000.09021.00
5.6.150.0030.08021.16
5.6.140.0030.03721.17
5.6.130.0070.03321.00
5.6.120.0030.05321.02
5.6.110.0070.03321.05
5.6.100.0130.04321.07
5.6.90.0070.03720.93
5.6.80.0000.04720.34
5.6.70.0100.07020.39
5.6.60.0100.08020.40
5.6.50.0070.06720.53
5.6.40.0170.06720.39
5.6.30.0030.06320.31
5.6.20.0030.08720.32
5.6.10.0030.08020.46
5.6.00.0030.04720.38
5.5.380.0130.04720.35
5.5.370.0030.04020.43
5.5.360.0070.07320.34
5.5.350.0100.08320.46
5.5.340.0100.07720.80
5.5.330.0070.08320.93
5.5.320.0030.08320.90
5.5.310.0070.07320.78
5.5.300.0030.04020.73
5.5.290.0000.09720.77
5.5.280.0070.08020.92
5.5.270.0070.03320.88
5.5.260.0170.06020.88
5.5.250.0130.07320.70
5.5.240.0100.03720.21
5.5.230.0070.05720.25
5.5.220.0100.08020.30
5.5.210.0130.07020.29
5.5.200.0070.05320.23
5.5.190.0100.08020.09
5.5.180.0030.08020.26
5.5.160.0000.04320.27
5.5.150.0030.04020.19
5.5.140.0000.04320.21
5.5.130.0100.06020.23
5.5.120.0030.04020.26
5.5.110.0070.08720.08
5.5.100.0130.06720.05
5.5.90.0030.08020.10
5.5.80.0130.07020.02
5.5.70.0100.07320.01
5.5.60.0030.06020.03
5.5.50.0130.06720.16
5.5.40.0130.07020.05
5.5.30.0030.04320.15
5.5.20.0030.08020.05
5.5.10.0100.03319.96
5.5.00.0070.03720.00
5.4.450.0100.07719.50
5.4.440.0070.08319.36
5.4.430.0030.03719.27
5.4.420.0030.08019.57
5.4.410.0100.04019.37
5.4.400.0100.07719.04
5.4.390.0070.07719.13
5.4.380.0030.04718.94
5.4.370.0130.06719.09
5.4.360.0030.07319.15
5.4.350.0000.08019.09
5.4.340.0000.03719.05
5.4.320.0000.04018.84
5.4.310.0070.07719.09
5.4.300.0030.05719.13
5.4.290.0030.08319.02
5.4.280.0070.04019.04
5.4.270.0030.03719.15
5.4.260.0030.08019.11
5.4.250.0100.07019.20
5.4.240.0130.07018.89
5.4.230.0030.08319.00
5.4.220.0100.06719.15
5.4.210.0100.07318.94
5.4.200.0130.06719.11
5.4.190.0100.07019.20
5.4.180.0030.07719.07
5.4.170.0030.07719.21
5.4.160.0030.08019.02
5.4.150.0130.07018.88
5.4.140.0000.03316.38
5.4.130.0130.06716.35
5.4.120.0070.02716.40
5.4.110.0030.04316.35
5.4.100.0070.04016.46
5.4.90.0130.02316.32
5.4.80.0000.03316.48
5.4.70.0100.07016.42
5.4.60.0000.08016.46
5.4.50.0100.06716.44
5.4.40.0100.05016.41
5.4.30.0030.03716.47
5.4.20.0070.03316.47
5.4.10.0100.06716.47
5.4.00.0030.03715.79
5.3.290.0100.08014.77
5.3.280.0070.07314.61
5.3.270.0000.03714.62
5.3.260.0170.07314.67
5.3.250.0100.07314.61
5.3.240.0130.07014.63
5.3.230.0130.03014.69
5.3.220.0130.04314.60
5.3.210.0100.07014.67
5.3.200.0100.03014.49
5.3.190.0070.06314.62
5.3.180.0200.06014.55
5.3.170.0100.06714.58
5.3.160.0070.07014.62
5.3.150.0070.03014.61
5.3.140.0000.03314.67
5.3.130.0000.04014.52
5.3.120.0070.07314.64
5.3.110.0070.07014.48
5.3.100.0070.03313.99
5.3.90.0000.03313.98
5.3.80.0030.04314.04
5.3.70.0100.02714.04
5.3.60.0000.03314.13
5.3.50.0030.07313.96
5.3.40.0030.05013.93
5.3.30.0070.07013.96
5.3.20.0130.06713.71
5.3.10.0030.03313.74
5.3.00.0030.03013.76
5.2.170.0100.05311.64
5.2.160.0000.05711.64
5.2.150.0030.03311.64
5.2.140.0030.06711.64
5.2.130.0000.02711.64
5.2.120.0000.02711.64
5.2.110.0030.06011.64
5.2.100.0030.05011.64
5.2.90.0100.02311.64
5.2.80.0030.03011.64
5.2.70.0030.05711.64
5.2.60.0030.02311.64
5.2.50.0100.04311.64
5.2.40.0030.05011.64
5.2.30.0100.04011.64
5.2.20.0100.05711.64
5.2.10.0000.05711.64
5.2.00.0000.02711.64
5.1.60.0100.04711.64
5.1.50.0070.05011.64
5.1.40.0130.04011.64
5.1.30.0070.05711.64
5.1.20.0070.05311.64
5.1.10.0000.05311.64
5.1.00.0070.02711.64
5.0.50.0030.04711.64
5.0.40.0000.03311.64
5.0.30.0000.06711.64
5.0.20.0000.04711.64
5.0.10.0030.03711.64
5.0.00.0100.06011.64
4.4.90.0030.02011.64
4.4.80.0070.03011.64
4.4.70.0030.03011.64
4.4.60.0000.03311.64
4.4.50.0000.03711.64
4.4.40.0070.05311.64
4.4.30.0000.03011.64
4.4.20.0000.03711.64
4.4.10.0030.03311.64
4.4.00.0030.05711.64
4.3.110.0030.01311.64
4.3.100.0000.01711.64
4.3.90.0070.01711.64
4.3.80.0000.04711.64
4.3.70.0000.01711.64
4.3.60.0000.01711.64
4.3.50.0000.03311.64
4.3.40.0000.05311.64
4.3.30.0030.03311.64
4.3.20.0030.01711.64
4.3.10.0030.02011.64
4.3.00.0000.03011.64

preferences:
42.63 ms | 401 KiB | 5 Q