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 $working_days++; }; $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.0060.00918.81
8.3.50.0080.01522.14
8.3.40.0090.00619.04
8.3.30.0070.00719.13
8.3.20.0000.00720.30
8.3.10.0000.00823.66
8.3.00.0070.00317.75
8.2.180.0090.00916.88
8.2.170.0140.00722.96
8.2.160.0110.00320.41
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0070.00022.18
8.2.110.0060.00320.53
8.2.100.0080.00318.09
8.2.90.0040.00419.36
8.2.80.0030.00618.00
8.2.70.0060.00317.88
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0100.00018.17
8.2.30.0040.00418.07
8.2.20.0030.00618.06
8.2.10.0040.00418.25
8.2.00.0060.00317.98
8.1.280.0130.00325.92
8.1.270.0080.00022.08
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0000.00923.87
8.1.230.0050.00519.09
8.1.220.0000.00817.77
8.1.210.0080.00018.77
8.1.200.0050.00517.50
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0070.00318.78
8.1.160.0000.00721.89
8.1.150.0000.00818.83
8.1.140.0040.00417.68
8.1.130.0030.00317.80
8.1.120.0030.00517.55
8.1.110.0000.00817.55
8.1.100.0050.00217.67
8.1.90.0040.00417.68
8.1.80.0040.00417.59
8.1.70.0000.00817.50
8.1.60.0040.00417.73
8.1.50.0000.00817.61
8.1.40.0000.00717.59
8.1.30.0030.00617.80
8.1.20.0000.00717.79
8.1.10.0000.00717.67
8.1.00.0000.00817.56
8.0.300.0040.00418.77
8.0.290.0050.00316.88
8.0.280.0070.00018.46
8.0.270.0030.00317.34
8.0.260.0030.00317.34
8.0.250.0030.00317.20
8.0.240.0000.00717.22
8.0.230.0000.00717.08
8.0.220.0030.00317.03
8.0.210.0000.00717.15
8.0.200.0030.00317.05
8.0.190.0030.00517.18
8.0.180.0040.00417.13
8.0.170.0000.00817.17
8.0.160.0070.00017.11
8.0.150.0040.00417.07
8.0.140.0000.00817.13
8.0.130.0030.00313.50
8.0.120.0080.00017.06
8.0.110.0070.00017.17
8.0.100.0040.00417.11
8.0.90.0040.00417.19
8.0.80.0060.00917.18
8.0.70.0030.00517.20
8.0.60.0040.00417.21
8.0.50.0040.00417.15
8.0.30.0130.00717.28
8.0.20.0130.00917.40
8.0.10.0040.00417.34
8.0.00.0080.01016.98
7.4.330.0030.00315.00
7.4.320.0000.00716.74
7.4.300.0030.00316.73
7.4.290.0070.00016.63
7.4.280.0030.00716.64
7.4.270.0000.00716.66
7.4.260.0000.00816.65
7.4.250.0030.00516.71
7.4.240.0050.00216.66
7.4.230.0000.00716.57
7.4.220.0060.01216.80
7.4.210.0140.00316.69
7.4.200.0030.00316.74
7.4.160.0000.02116.80
7.4.150.0140.00717.40
7.4.140.0130.00617.86
7.4.130.0070.01016.70
7.4.120.0140.00316.71
7.4.110.0130.01016.77
7.4.100.0090.01516.92
7.4.90.0060.01216.70
7.4.80.0090.00919.39
7.4.70.0070.01116.82
7.4.60.0110.00616.72
7.4.50.0000.00816.31
7.4.40.0080.01116.77
7.4.30.0070.01016.77
7.4.00.0090.00615.34
7.3.330.0060.00013.32
7.3.320.0030.00313.36
7.3.310.0040.00316.38
7.3.300.0030.00316.50
7.3.290.0140.00016.42
7.3.280.0090.00816.44
7.3.270.0130.00317.40
7.3.260.0100.00716.67
7.3.250.0060.01216.52
7.3.240.0150.00316.58
7.3.230.0140.00716.94
7.3.210.0120.00616.64
7.3.200.0090.00919.39
7.3.190.0040.01316.52
7.3.180.0090.00916.73
7.3.170.0060.00916.57
7.3.160.0120.01016.52
7.3.10.0100.00516.78
7.3.00.0130.00216.82
7.2.330.0060.01216.91
7.2.320.0120.00616.78
7.2.310.0070.01016.68
7.2.300.0030.01317.00
7.2.290.0120.00616.91
7.2.130.0100.00317.05
7.2.120.0080.01017.07
7.2.110.0100.00616.95
7.2.100.0080.00816.98
7.2.90.0050.01017.08
7.2.80.0050.01216.83
7.2.70.0080.01017.11
7.2.60.0070.00717.04
7.2.50.0070.01116.90
7.2.40.0100.00616.87
7.2.30.0090.01016.89
7.2.20.0080.00517.02
7.2.10.0090.00716.92
7.2.00.0090.00717.61
7.1.250.0070.00915.73
7.1.100.0080.00418.14
7.1.70.0040.00417.56
7.1.60.0100.01419.32
7.1.50.0040.01817.21
7.1.00.0100.07022.46
7.0.200.0030.00516.82
7.0.140.0100.06722.09
7.0.100.0100.08320.02
7.0.90.0070.04019.87
7.0.80.0070.08019.98
7.0.70.0100.04719.85
7.0.60.0100.07719.88
7.0.50.0070.08320.25
7.0.40.0100.07720.02
7.0.30.0100.04719.91
7.0.20.0170.04020.04
7.0.10.0070.08320.02
7.0.00.0070.06720.12
5.6.280.0000.07321.09
5.6.250.0070.08020.78
5.6.240.0200.06720.55
5.6.230.0170.07320.75
5.6.220.0030.06720.66
5.6.210.0030.09020.61
5.6.200.0030.06320.94
5.6.190.0100.07321.14
5.6.180.0030.07721.11
5.6.170.0100.08321.09
5.6.160.0100.07320.94
5.6.150.0030.04321.04
5.6.140.0000.08320.96
5.6.130.0070.08321.07
5.6.120.0100.06721.16
5.6.110.0070.08721.10
5.6.100.0130.04321.00
5.6.90.0130.07720.99
5.6.80.0100.08020.42
5.6.70.0130.06020.39
5.6.60.0070.04720.41
5.6.50.0170.06720.46
5.6.40.0100.07320.38
5.6.30.0200.06320.42
5.6.20.0170.04020.39
5.6.10.0030.07720.43
5.6.00.0100.07020.39
5.5.380.0100.04720.36
5.5.370.0070.08020.38
5.5.360.0130.05020.34
5.5.350.0130.05020.37
5.5.340.0200.07020.88
5.5.330.0100.06320.92
5.5.320.0070.08320.80
5.5.310.0130.05720.86
5.5.300.0100.07320.93
5.5.290.0070.04720.80
5.5.280.0170.07320.89
5.5.270.0100.07320.73
5.5.260.0070.07720.86
5.5.250.0100.03720.64
5.5.240.0100.07720.12
5.5.230.0000.08320.27
5.5.220.0170.05720.16
5.5.210.0030.08720.24
5.5.200.0100.05020.13
5.5.190.0030.05020.13
5.5.180.0130.07720.15
5.5.160.0000.08720.28
5.5.150.0100.07720.28
5.5.140.0100.07719.96
5.5.130.0030.05720.18
5.5.120.0070.08720.24
5.5.110.0030.08720.23
5.5.100.0070.08319.99
5.5.90.0070.05320.16
5.5.80.0030.07720.07
5.5.70.0100.06020.16
5.5.60.0100.07720.06
5.5.50.0100.07720.08
5.5.40.0070.07320.15
5.5.30.0130.07320.06
5.5.20.0100.07720.00
5.5.10.0070.08020.02
5.5.00.0070.07720.13
5.4.450.0000.05019.42
5.4.440.0030.09319.38
5.4.430.0070.06319.37
5.4.420.0070.07019.55
5.4.410.0130.05719.24
5.4.400.0070.05319.18
5.4.390.0170.06719.05
5.4.380.0070.07719.09
5.4.370.0030.08319.23
5.4.360.0070.07719.03
5.4.350.0000.06019.05
5.4.340.0100.07319.05
5.4.320.0070.07719.21
5.4.310.0030.06019.14
5.4.300.0100.04319.02
5.4.290.0070.07719.18
5.4.280.0070.05018.85
5.4.270.0070.05319.14
5.4.260.0070.07019.04
5.4.250.0100.06319.17
5.4.240.0070.06719.02
5.4.230.0100.07319.06
5.4.220.0070.05718.94
5.4.210.0030.04719.22
5.4.200.0070.07719.02
5.4.190.0030.06719.13
5.4.180.0100.03719.08
5.4.170.0170.03019.13
5.4.160.0170.06719.11
5.4.150.0130.04019.14
5.4.140.0030.08016.33
5.4.130.0000.06016.42
5.4.120.0100.07016.45
5.4.110.0070.03316.38
5.4.100.0070.07016.39
5.4.90.0100.04016.41
5.4.80.0170.04016.30
5.4.70.0070.07716.30
5.4.60.0070.04716.26
5.4.50.0170.04716.36
5.4.40.0130.06716.38
5.4.30.0030.04316.48
5.4.20.0130.05316.45
5.4.10.0030.04316.45
5.4.00.0100.06715.63
5.3.290.0100.07714.72
5.3.280.0070.07014.70
5.3.270.0070.04014.72
5.3.260.0030.04714.66
5.3.250.0030.07714.57
5.3.240.0270.02714.65
5.3.230.0170.04714.66
5.3.220.0070.06314.63
5.3.210.0030.04014.63
5.3.200.0000.07714.63
5.3.190.0030.07714.54
5.3.180.0070.06014.57
5.3.170.0130.06714.49
5.3.160.0030.07714.48
5.3.150.0170.04014.58
5.3.140.0030.07014.53
5.3.130.0070.06314.60
5.3.120.0070.05014.61
5.3.110.0030.05014.61
5.3.100.0030.06314.09
5.3.90.0030.05313.95
5.3.80.0130.06714.00
5.3.70.0100.07014.03
5.3.60.0100.06314.05
5.3.50.0070.06013.95
5.3.40.0070.07014.00
5.3.30.0070.06313.79
5.3.20.0070.04313.59
5.3.10.0100.06313.71
5.3.00.0070.06313.65
5.2.170.0030.03011.17
5.2.160.0000.04311.05
5.2.150.0100.06011.09
5.2.140.0070.06311.15
5.2.130.0030.06011.24
5.2.120.0000.03711.02
5.2.110.0170.01310.98
5.2.100.0030.07011.02
5.2.90.0000.03011.15
5.2.80.0070.05711.20
5.2.70.0000.03011.17
5.2.60.0070.05711.05
5.2.50.0000.03011.02
5.2.40.0100.05310.99
5.2.30.0030.06011.11
5.2.20.0000.03011.09
5.2.10.0000.06310.95
5.2.00.0100.05310.61
5.1.60.0030.06710.34
5.1.50.0030.05310.34
5.1.40.0070.04010.34
5.1.30.0030.06310.34
5.1.20.0030.02310.35
5.1.10.0030.05310.34
5.1.00.0070.05010.34
5.0.50.0000.03310.34
5.0.40.0030.02310.34
5.0.30.0000.04310.34
5.0.20.0030.03710.34
5.0.10.0070.03310.34
5.0.00.0100.02710.34
4.4.90.0100.02710.34
4.4.80.0030.03310.34
4.4.70.0000.03710.34
4.4.60.0000.03710.34
4.4.50.0030.03310.34
4.4.40.0030.03710.34
4.4.30.0030.02710.34
4.4.20.0070.03010.34
4.4.10.0030.03010.34
4.4.00.0070.04710.34
4.3.110.0070.02710.34
4.3.100.0070.02710.34
4.3.90.0030.03710.34
4.3.80.0030.03710.34
4.3.70.0030.03310.34
4.3.60.0030.03310.34
4.3.50.0030.02310.34
4.3.40.0070.03710.34
4.3.30.0000.02010.34
4.3.20.0030.03310.34
4.3.10.0030.03310.34
4.3.00.0030.03010.34

preferences:
44.81 ms | 401 KiB | 5 Q