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); if($what_day<=5) { // 6 and 7 are weekend days $working_days++; $total_days++; }; $begin+=86400; // +1 day }; $testString = "working days: " . $working_days . " total days: " . $total_days; 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.0120.00318.64
8.3.50.0100.01221.20
8.3.40.0130.00919.09
8.3.30.0030.01019.04
8.3.20.0040.00420.29
8.3.10.0050.00321.74
8.3.00.0030.00717.84
8.2.180.0100.00716.48
8.2.170.0090.00622.96
8.2.160.0070.00720.52
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0000.00822.04
8.2.110.0040.00420.53
8.2.100.0080.00418.03
8.2.90.0040.00419.34
8.2.80.0030.00517.97
8.2.70.0000.00817.75
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0050.00519.72
8.2.30.0040.00418.20
8.2.20.0030.00617.82
8.2.10.0040.00418.06
8.2.00.0040.00418.00
8.1.280.0130.00725.92
8.1.270.0070.00321.93
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.97
8.1.230.0070.00319.11
8.1.220.0050.00317.88
8.1.210.0030.00618.77
8.1.200.0090.00017.48
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0050.00518.71
8.1.160.0000.00722.01
8.1.150.0000.00718.90
8.1.140.0000.00717.64
8.1.130.0000.00717.98
8.1.120.0030.00417.68
8.1.110.0000.00817.71
8.1.100.0070.00017.72
8.1.90.0040.00417.54
8.1.80.0050.00217.68
8.1.70.0030.00517.58
8.1.60.0080.00017.77
8.1.50.0030.00617.70
8.1.40.0040.00417.66
8.1.30.0040.00417.76
8.1.20.0040.00417.72
8.1.10.0040.00417.66
8.1.00.0050.00217.71
8.0.300.0030.00718.77
8.0.290.0070.00016.75
8.0.280.0040.00418.41
8.0.270.0000.00817.02
8.0.260.0000.00617.34
8.0.250.0080.00017.18
8.0.240.0030.00317.02
8.0.230.0050.00217.15
8.0.220.0000.00716.98
8.0.210.0000.00716.98
8.0.200.0070.00017.16
8.0.190.0000.00817.16
8.0.180.0040.00417.11
8.0.170.0030.00517.09
8.0.160.0000.00716.97
8.0.150.0050.00317.00
8.0.140.0080.00016.97
8.0.130.0060.00013.45
8.0.120.0080.00017.05
8.0.110.0040.00416.98
8.0.100.0030.00517.07
8.0.90.0040.00416.95
8.0.80.0090.00617.14
8.0.70.0040.00416.99
8.0.60.0040.00417.09
8.0.50.0000.00817.13
8.0.30.0080.01117.41
8.0.20.0110.01117.40
8.0.10.0070.00017.14
8.0.00.0070.01016.88
7.4.330.0030.00315.00
7.4.320.0030.00316.54
7.4.300.0030.00316.62
7.4.290.0000.00716.76
7.4.280.0100.00016.54
7.4.270.0030.00316.66
7.4.260.0070.00316.71
7.4.250.0000.00916.62
7.4.240.0020.00516.68
7.4.230.0000.00716.80
7.4.220.0070.01016.81
7.4.210.0100.00316.68
7.4.200.0030.00316.73
7.4.160.0100.00616.74
7.4.150.0140.00517.40
7.4.140.0130.00617.86
7.4.130.0080.01116.66
7.4.120.0090.00816.79
7.4.110.0140.01016.69
7.4.100.0070.01716.67
7.4.90.0070.01016.68
7.4.80.0100.00719.39
7.4.70.0120.00916.81
7.4.60.0070.01016.88
7.4.50.0030.00316.80
7.4.40.0120.00616.58
7.4.30.0100.00716.77
7.4.10.0120.00515.19
7.4.00.0070.01015.10
7.3.330.0030.00313.43
7.3.320.0000.00513.50
7.3.310.0040.00416.34
7.3.300.0000.00716.43
7.3.290.0090.00616.46
7.3.280.0100.00816.46
7.3.270.0160.00617.40
7.3.260.0100.00716.61
7.3.250.0120.00716.68
7.3.240.0130.01016.48
7.3.230.0120.00916.56
7.3.210.0060.01216.46
7.3.200.0180.00419.39
7.3.190.0090.00916.43
7.3.180.0110.01416.67
7.3.170.0060.01016.42
7.3.160.0110.01116.75
7.3.130.0110.00714.75
7.3.120.0100.00714.89
7.3.110.0060.01014.97
7.3.100.0050.01214.90
7.3.90.0040.01114.91
7.3.80.0100.00315.04
7.3.70.0110.00514.95
7.3.60.0120.00514.71
7.3.50.0030.00814.98
7.3.40.0030.00714.97
7.3.30.0030.01015.07
7.3.20.0080.00716.77
7.3.10.0070.00816.76
7.3.00.0100.00316.78
7.2.330.0100.00716.78
7.2.320.0110.00717.00
7.2.310.0060.01216.98
7.2.300.0130.00316.59
7.2.290.0120.00616.94
7.2.260.0000.01915.20
7.2.250.0130.00615.29
7.2.240.0080.00515.24
7.2.230.0070.00915.11
7.2.220.0040.00715.27
7.2.210.0070.00815.30
7.2.200.0050.00915.14
7.2.190.0060.01015.21
7.2.180.0060.00615.27
7.2.170.0060.01015.26
7.2.160.0060.00815.18
7.2.150.0060.01017.08
7.2.140.0050.01117.13
7.2.130.0110.00317.25
7.2.120.0070.00717.17
7.2.110.0050.00717.06
7.2.100.0060.01116.94
7.2.90.0090.00517.17
7.2.80.0040.00717.12
7.2.70.0110.00317.07
7.2.60.0110.00316.99
7.2.50.0070.01017.18
7.2.40.0080.00517.12
7.2.30.0050.01017.05
7.2.20.0040.00616.99
7.2.10.0080.00617.13
7.2.00.0070.00817.77
7.1.330.0060.00715.84
7.1.320.0100.00315.83
7.1.310.0070.00515.99
7.1.300.0040.00915.76
7.1.290.0060.00615.87
7.1.280.0050.00815.93
7.1.270.0080.00616.01
7.1.260.0110.00515.84
7.1.250.0060.00716.07
7.1.240.0040.00715.72
7.1.230.0030.00916.10
7.1.220.0100.00716.02
7.1.210.0060.00615.92
7.1.200.0040.00816.03
7.1.190.0070.00715.86
7.1.180.0070.01115.88
7.1.170.0060.00615.97
7.1.160.0000.01416.18
7.1.150.0060.00615.98
7.1.140.0030.00616.00
7.1.130.0090.00616.00
7.1.120.0070.01015.99
7.1.110.0110.00016.13
7.1.100.0020.01117.02
7.1.90.0040.01115.95
7.1.80.0080.00815.94
7.1.70.0060.00716.67
7.1.60.0100.00817.74
7.1.50.0100.00516.69
7.1.40.0070.00716.08
7.1.30.0000.00915.77
7.1.20.0070.00715.92
7.1.10.0030.01015.71
7.1.00.0050.04219.30
7.0.330.0040.00715.60
7.0.320.0000.01515.50
7.0.310.0050.01015.52
7.0.300.0060.00615.66
7.0.290.0000.01215.40
7.0.280.0050.00515.43
7.0.270.0060.00915.51
7.0.260.0070.00715.58
7.0.250.0040.01115.79
7.0.240.0030.00915.51
7.0.230.0090.00615.66
7.0.220.0040.00415.45
7.0.210.0060.00615.56
7.0.200.0010.01116.24
7.0.190.0070.01015.36
7.0.180.0050.00515.55
7.0.170.0070.00715.67
7.0.160.0100.00715.29
7.0.150.0090.00615.71
7.0.140.0050.02718.73
7.0.130.0030.00615.45
7.0.120.0110.00315.64
7.0.110.0080.02017.83
7.0.100.0030.02817.63
7.0.90.0060.02517.80
7.0.80.0030.02217.68
7.0.70.0050.02817.86
7.0.60.0110.02517.71
7.0.50.0190.02117.84
7.0.40.0030.02416.70
7.0.30.0040.01916.87
7.0.20.0000.02416.79
7.0.10.0090.01916.66
7.0.00.0040.02416.77
5.6.400.0000.01014.75
5.6.390.0100.00314.51
5.6.380.0070.00714.70
5.6.370.0040.00814.45
5.6.360.0050.00414.40
5.6.350.0110.00414.97
5.6.340.0040.00414.81
5.6.330.0100.00714.70
5.6.320.0070.00614.55
5.6.310.0030.01314.86
5.6.300.0100.00714.37
5.6.290.0060.00914.66
5.6.280.0120.03517.60
5.6.270.0040.01114.81
5.6.260.0080.02017.67
5.6.250.0050.02217.67
5.6.240.0080.02217.64
5.6.230.0070.02517.51
5.6.220.0020.02517.55
5.6.210.0050.02317.60
5.6.200.0080.02317.60
5.6.190.0040.02317.66
5.6.180.0050.02117.61
5.6.170.0070.02017.65
5.6.160.0030.02517.57
5.6.150.0030.03017.73
5.6.140.0020.02717.61
5.6.130.0060.01917.60
5.6.120.0060.01917.45
5.6.110.0040.02417.64
5.6.100.0040.02317.67
5.6.90.0030.02317.70
5.6.80.0050.02217.15
5.6.70.0060.02017.25
5.6.60.0040.01917.34
5.6.50.0020.02317.37
5.6.40.0030.05017.27
5.6.30.0020.02717.35
5.6.20.0070.01817.11
5.6.10.0050.02217.25
5.6.00.0100.03817.23
5.5.380.0090.01916.07
5.5.370.0050.02315.97
5.5.360.0030.02716.11
5.5.350.0020.02916.07
5.5.340.0030.02716.32
5.5.330.0050.02316.37
5.5.320.0070.01816.28
5.5.310.0060.02116.32
5.5.300.0090.02516.19
5.5.290.0060.02016.12
5.5.280.0050.02116.23
5.5.270.0030.02216.40
5.5.260.0030.02416.31
5.5.250.0030.02216.23
5.5.240.0040.02216.06
5.5.230.0080.02015.96
5.5.220.0030.02115.85
5.5.210.0050.02315.93
5.5.200.0050.03615.83
5.5.190.0030.04315.80
5.5.180.0110.03315.96
5.5.170.0090.00614.55
5.5.160.0050.02315.96
5.5.150.0080.01815.89
5.5.140.0070.04515.78
5.5.130.0080.03516.12
5.5.120.0030.04415.88
5.5.110.0070.02015.91
5.5.100.0050.04415.83
5.5.90.0120.03115.92
5.5.80.0100.03715.98
5.5.70.0060.02315.72
5.5.60.0070.03315.89
5.5.50.0060.02615.79
5.5.40.0000.02715.86
5.5.30.0100.02215.92
5.5.20.0060.02215.76
5.5.10.0080.03215.91
5.5.00.0090.02215.60
5.4.450.0040.02315.35
5.4.440.0060.01815.32
5.4.430.0080.01915.26
5.4.420.0030.02015.26
5.4.410.0030.02215.18
5.4.400.0050.02115.18
5.4.390.0080.02315.33
5.4.380.0040.01815.34
5.4.370.0020.02015.13
5.4.360.0060.01615.10
5.4.350.0030.04015.13
5.4.340.0080.03314.93
5.4.330.0060.00311.48
5.4.320.0060.03815.25
5.4.310.0090.02415.22
5.4.300.0080.03615.29
5.4.290.0020.02215.18
5.4.280.0050.02714.99
5.4.270.0030.02214.97
5.4.260.0030.02515.31
5.4.250.0070.03115.13
5.4.240.0070.03715.07
5.4.230.0030.02515.25
5.4.220.0060.02315.01
5.4.210.0020.02515.31
5.4.200.0050.02115.34
5.4.190.0130.01515.21
5.4.180.0050.02215.01
5.4.170.0050.02015.18
5.4.160.0050.02515.07
5.4.150.0080.02215.36
5.4.140.0080.02613.72
5.4.130.0150.01313.74
5.4.120.0070.02913.90
5.4.110.0060.02313.88
5.4.100.0000.02513.86
5.4.90.0050.01913.91
5.4.80.0030.02213.90
5.4.70.0050.03013.86
5.4.60.0070.04513.90
5.4.50.0030.02313.98
5.4.40.0010.03913.90
5.4.30.0080.02513.82
5.4.20.0020.02213.74
5.4.10.0100.03313.85
5.4.00.0020.02213.48
5.3.290.0000.03714.68
5.3.280.0070.05014.59
5.3.270.0030.04014.62
5.3.260.0100.05014.73
5.3.250.0100.03714.74
5.3.240.0030.04014.56
5.3.230.0070.04314.68
5.3.220.0070.04014.54
5.3.210.0000.04014.56
5.3.200.0070.03314.70
5.3.190.0070.03714.54
5.3.180.0070.03314.53
5.3.170.0000.07714.64
5.3.160.0030.07314.54
5.3.150.0070.03714.52
5.3.140.0030.04014.55
5.3.130.0070.06314.54
5.3.120.0000.03714.68
5.3.110.0130.06014.60
5.3.100.0000.04014.07
5.3.90.0030.03714.01
5.3.80.0000.04314.10
5.3.70.0000.03714.25
5.3.60.0070.03014.06
5.3.50.0070.03013.95
5.3.40.0000.03713.98
5.3.30.0000.03713.93
5.3.20.0030.03313.91
5.3.10.0030.07013.52
5.3.00.0130.06313.70
5.2.170.0000.05012.07
5.2.160.0070.03712.07
5.2.150.0030.03712.07
5.2.140.0100.02012.07
5.2.130.0030.05012.07
5.2.120.0030.02312.07
5.2.110.0030.04712.07
5.2.100.0000.02712.07
5.2.90.0100.04312.07
5.2.80.0070.02312.07
5.2.70.0030.06012.07
5.2.60.0000.04012.07
5.2.50.0070.05312.07
5.2.40.0030.04312.07
5.2.30.0030.02712.07
5.2.20.0030.06312.07
5.2.10.0030.04012.07
5.2.00.0030.05312.07
5.1.60.0000.03012.07
5.1.50.0000.05712.07
5.1.40.0000.02712.07
5.1.30.0000.03012.07
5.1.20.0070.04312.07
5.1.10.0000.03312.07
5.1.00.0000.02712.07
5.0.50.0000.03712.07
5.0.40.0000.02312.07
5.0.30.0000.03712.07
5.0.20.0070.02312.07
5.0.10.0030.01712.07
5.0.00.0030.03712.07
4.4.90.0070.02712.07
4.4.80.0030.01312.07
4.4.70.0070.02712.07
4.4.60.0030.02712.07
4.4.50.0000.01712.07
4.4.40.0030.04312.07
4.4.30.0030.03312.07
4.4.20.0030.02712.07
4.4.10.0000.03012.07
4.4.00.0130.01312.07
4.3.110.0000.03012.07
4.3.100.0030.03312.07
4.3.90.0000.03012.07
4.3.80.0000.02312.07
4.3.70.0000.03012.07
4.3.60.0000.01712.07
4.3.50.0000.02012.07
4.3.40.0000.03012.07
4.3.30.0070.01312.07
4.3.20.0030.01312.07
4.3.10.0000.01712.07
4.3.00.0030.01012.07

preferences:
39.79 ms | 401 KiB | 5 Q