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 = "working days: " . $working_days . " weekend days: " . ($total_days - $working_days); $testString = "working hours: " . ($working_days * 16); 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.0110.00318.55
8.3.50.0140.00316.42
8.3.40.0070.00718.92
8.3.30.0030.01219.10
8.3.20.0040.00420.25
8.3.10.0050.00321.90
8.3.00.0030.00717.50
8.2.180.0130.01016.72
8.2.170.0100.00722.96
8.2.160.0070.00720.43
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00422.07
8.2.110.0040.00422.12
8.2.100.0090.00317.88
8.2.90.0040.00419.43
8.2.80.0080.00017.97
8.2.70.0080.00017.74
8.2.60.0070.00318.05
8.2.50.0090.00018.07
8.2.40.0030.00719.81
8.2.30.0050.00518.15
8.2.20.0000.00817.85
8.2.10.0000.00818.20
8.2.00.0040.00417.84
8.1.270.0160.00022.19
8.1.260.0000.00726.35
8.1.250.0070.00728.09
8.1.240.0070.00323.80
8.1.230.0070.00419.16
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0070.00317.48
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00818.64
8.1.160.0000.00721.94
8.1.150.0060.00319.02
8.1.140.0050.00217.68
8.1.130.0000.00717.91
8.1.120.0040.00417.65
8.1.110.0060.00317.50
8.1.100.0040.00317.54
8.1.90.0040.00417.65
8.1.80.0040.00417.59
8.1.70.0070.00017.54
8.1.60.0030.00517.57
8.1.50.0030.00617.65
8.1.40.0030.00617.66
8.1.30.0060.00317.82
8.1.20.0040.00417.74
8.1.10.0000.00717.64
8.1.00.0000.00817.70
8.0.300.0000.00818.77
8.0.290.0080.00016.88
8.0.280.0040.00418.50
8.0.270.0040.00417.32
8.0.260.0000.00717.33
8.0.250.0030.00317.15
8.0.240.0030.00317.13
8.0.230.0030.00317.09
8.0.220.0030.00317.07
8.0.210.0030.00317.13
8.0.200.0000.00717.16
8.0.190.0040.00417.21
8.0.180.0080.00017.02
8.0.170.0090.00016.98
8.0.160.0030.00517.09
8.0.150.0040.00417.09
8.0.140.0000.00717.11
8.0.130.0050.00013.46
8.0.120.0000.00817.05
8.0.110.0000.00817.07
8.0.100.0000.00716.89
8.0.90.0040.00416.96
8.0.80.0030.01717.03
8.0.70.0040.00417.11
8.0.60.0000.00816.98
8.0.50.0000.00717.10
8.0.30.0120.00717.36
8.0.20.0130.01017.40
8.0.10.0040.00417.27
8.0.00.0110.01216.83
7.4.330.0000.00615.03
7.4.320.0030.00316.77
7.4.300.0070.00016.80
7.4.290.0000.00716.69
7.4.280.0110.00016.76
7.4.270.0030.00316.68
7.4.260.0000.00916.74
7.4.250.0000.00716.63
7.4.240.0040.00416.71
7.4.230.0000.00716.75
7.4.220.0030.01516.63
7.4.210.0130.00016.63
7.4.200.0020.00516.84
7.4.160.0060.00916.64
7.4.150.0130.00617.40
7.4.140.0090.01117.86
7.4.130.0060.01216.65
7.4.120.0090.00816.84
7.4.110.0210.00316.54
7.4.100.0090.01216.80
7.4.90.0110.00616.88
7.4.80.0100.00719.39
7.4.70.0110.00716.66
7.4.60.0040.01216.61
7.4.50.0000.00716.89
7.4.40.0090.00916.56
7.4.30.0100.00716.68
7.4.00.0040.01215.01
7.3.330.0050.00013.30
7.3.320.0050.00013.52
7.3.310.0030.00316.46
7.3.300.0030.00316.46
7.3.290.0150.00316.37
7.3.280.0090.00816.46
7.3.270.0100.00717.40
7.3.260.0100.00716.58
7.3.250.0130.00716.61
7.3.240.0110.00716.62
7.3.230.0060.01216.65
7.3.210.0110.00716.82
7.3.200.0130.01019.39
7.3.190.0070.01016.44
7.3.180.0090.01616.60
7.3.170.0080.00816.62
7.3.160.0130.00616.41
7.3.120.0100.00615.09
7.3.110.0040.01414.73
7.3.100.0090.00615.04
7.3.90.0040.00915.02
7.3.80.0060.00915.34
7.3.70.0070.00414.93
7.3.60.0110.00315.06
7.3.50.0060.00915.00
7.3.40.0100.00314.86
7.3.30.0030.00715.12
7.3.20.0040.00716.86
7.3.10.0050.00916.66
7.3.00.0090.00716.64
7.2.330.0110.00616.59
7.2.320.0100.01216.68
7.2.310.0300.02316.88
7.2.300.0080.00916.79
7.2.290.0100.00716.97
7.2.250.0120.00615.45
7.2.240.0090.00915.26
7.2.230.0090.00615.34
7.2.220.0100.00015.37
7.2.210.0060.00915.04
7.2.200.0000.01115.22
7.2.190.0090.00615.38
7.2.180.0120.00315.17
7.2.170.0060.00815.22
7.2.130.0150.00616.61
7.2.120.0140.00016.68
7.2.110.0060.01216.50
7.2.100.0060.01216.80
7.2.90.0120.00616.84
7.2.80.0080.01116.81
7.2.70.0110.00416.70
7.2.60.0130.01016.84
7.2.50.0110.00617.01
7.2.40.0000.01417.06
7.2.30.0150.00616.66
7.2.20.0100.01016.78
7.2.10.0060.00616.83
7.2.00.0060.01018.37
7.1.330.0000.01515.81
7.1.320.0000.01315.94
7.1.310.0030.01015.86
7.1.300.0120.00315.89
7.1.290.0000.01116.09
7.1.280.0070.00716.11
7.1.270.0070.00716.05
7.1.260.0080.00515.87
7.1.250.0120.00315.79
7.1.100.0060.00618.18
7.1.70.0000.00717.11
7.1.60.0100.01319.32
7.1.50.0140.00717.18
7.1.00.0100.07022.44
7.0.200.0030.00616.66
7.0.140.0070.09322.09
7.0.80.0430.08319.81
7.0.70.0300.06719.81
7.0.60.0500.04319.82
7.0.50.0470.08720.36
7.0.40.0170.06020.08
7.0.30.0130.03720.16
7.0.20.0070.08320.04
7.0.10.0070.04319.95
7.0.00.0070.08319.95
5.6.280.0070.07021.00
5.6.230.0070.08720.70
5.6.220.0100.07720.42
5.6.210.0100.03320.55
5.6.200.0070.04721.04
5.6.190.0130.07721.06
5.6.180.0130.05020.94
5.6.170.0000.09021.09
5.6.160.0000.08321.02
5.6.150.0100.08321.04
5.6.140.0100.08021.16
5.6.130.0000.08721.02
5.6.120.0130.07721.17
5.6.110.0070.05321.03
5.6.100.0130.08020.99
5.6.90.0100.05021.12
5.6.80.0200.06320.47
5.6.70.0130.07320.41
5.6.60.0100.07320.54
5.6.50.0170.07020.44
5.6.40.0130.07020.29
5.6.30.0100.08020.40
5.6.20.0030.05720.37
5.6.10.0100.07720.46
5.6.00.0030.08020.42
5.5.370.0030.08720.32
5.5.360.0030.06020.50
5.5.350.0030.09020.37
5.5.340.0130.06320.84
5.5.330.0100.07320.77
5.5.320.0070.08320.89
5.5.310.0030.06020.84
5.5.300.0130.04320.92
5.5.290.0100.08020.80
5.5.280.0030.09020.82
5.5.270.0130.06720.73
5.5.260.0100.08020.93
5.5.250.0100.07020.68
5.5.240.0100.07320.13
5.5.230.0130.07320.31
5.5.220.0070.04020.21
5.5.210.0070.03720.30
5.5.200.0070.07720.22
5.5.190.0130.04720.24
5.5.180.0070.04320.24
5.5.160.0130.04720.27
5.5.150.0070.08020.09
5.5.140.0100.08020.18
5.5.130.0100.06020.13
5.5.120.0200.07320.18
5.5.110.0030.08320.17
5.5.100.0100.07320.05
5.5.90.0130.07320.16
5.5.80.0170.07019.91
5.5.70.0030.08320.07
5.5.60.0070.07720.07
5.5.50.0070.07320.03
5.5.40.0100.08020.09
5.5.30.0030.08720.02
5.5.20.0070.07320.05
5.5.10.0100.06320.12
5.5.00.0030.07319.98
5.4.450.0070.08319.50
5.4.440.0030.06019.50
5.4.430.0070.07719.48
5.4.420.0030.07719.46
5.4.410.0070.04319.09
5.4.400.0000.07719.15
5.4.390.0070.07719.09
5.4.380.0070.04719.09
5.4.370.0100.06319.19
5.4.360.0170.07018.85
5.4.350.0070.05319.03
5.4.340.0030.07318.90
5.4.320.0030.08319.16
5.4.310.0130.06719.06
5.4.300.0000.08319.14
5.4.290.0100.07319.18
5.4.280.0070.07719.04
5.4.270.0170.06719.20
5.4.260.0030.07318.94
5.4.250.0200.06719.05
5.4.240.0000.08318.84
5.4.230.0070.05719.08
5.4.220.0030.05719.22
5.4.210.0070.07319.12
5.4.200.0030.08319.12
5.4.190.0130.07318.86
5.4.180.0230.06019.13
5.4.170.0170.07318.86
5.4.160.0200.04718.83
5.4.150.0100.06318.92
5.4.140.0070.03716.40
5.4.130.0070.07316.27
5.4.120.0000.05316.39
5.4.110.0130.06316.42
5.4.100.0000.04316.43
5.4.90.0070.04316.38
5.4.80.0100.03316.33
5.4.70.0100.05716.45
5.4.60.0000.05016.37
5.4.50.0130.04716.47
5.4.40.0070.07016.40
5.4.30.0170.05016.42
5.4.20.0000.04016.43
5.4.10.0000.07716.36
5.4.00.0170.04315.89
5.3.290.0000.08314.77
5.3.280.0130.07014.63
5.3.270.0130.07014.62
5.3.260.0200.05014.59
5.3.250.0030.08014.69
5.3.240.0070.06714.57
5.3.230.0030.07314.71
5.3.220.0030.06714.59
5.3.210.0070.07314.67
5.3.200.0000.08014.63
5.3.190.0030.07714.55
5.3.180.0070.04714.53
5.3.170.0000.06714.59
5.3.160.0070.08014.48
5.3.150.0100.07014.57
5.3.140.0070.07014.66
5.3.130.0070.06714.56
5.3.120.0070.04014.67
5.3.110.0070.06014.43
5.3.100.0130.06713.99
5.3.90.0070.04014.16
5.3.80.0070.07314.14
5.3.70.0130.05714.08
5.3.60.0170.06713.89
5.3.50.0070.05014.04
5.3.40.0000.06014.06
5.3.30.0070.07714.03
5.3.20.0030.04713.80
5.3.10.0070.04713.69
5.3.00.0000.06713.80
5.2.170.0030.03711.25
5.2.160.0100.03311.03
5.2.150.0100.05711.08
5.2.140.0000.04711.16
5.2.130.0030.04310.98
5.2.120.0170.04711.20
5.2.110.0070.06011.11
5.2.100.0030.06011.10
5.2.90.0030.05011.16
5.2.80.0030.06011.11
5.2.70.0030.06711.23
5.2.60.0030.06311.04
5.2.50.0030.03711.08
5.2.40.0070.06311.11
5.2.30.0030.04710.88
5.2.20.0130.05311.01
5.2.10.0070.05710.81
5.2.00.0070.03310.86
5.1.60.0030.0509.84
5.1.50.0000.0339.83
5.1.40.0030.0509.96
5.1.30.0030.03310.40
5.1.20.0030.04010.47
5.1.10.0030.05310.16
5.1.00.0130.04710.06
5.0.50.0030.0408.39
5.0.40.0070.0408.50
5.0.30.0070.0638.08
5.0.20.0100.0338.20
5.0.10.0100.0238.02
5.0.00.0000.0678.06
4.4.90.0000.0336.59
4.4.80.0000.0336.59
4.4.70.0030.0336.59
4.4.60.0000.0376.59
4.4.50.0030.0276.59
4.4.40.0030.0536.59
4.4.30.0070.0306.59
4.4.20.0100.0276.59
4.4.10.0030.0336.59
4.4.00.0000.0536.59
4.3.110.0000.0276.59
4.3.100.0000.0336.59
4.3.90.0070.0336.59
4.3.80.0000.0536.59
4.3.70.0000.0336.59
4.3.60.0000.0276.59
4.3.50.0070.0336.59
4.3.40.0000.0506.59
4.3.30.0000.0376.59
4.3.20.0030.0236.59
4.3.10.0000.0376.59
4.3.00.0030.0336.59

preferences:
62.14 ms | 400 KiB | 5 Q