3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* the difference in days between today and '$delay' number business days (M-F). yes. */ function g($current_day, $delay) { /* wraps around to the next day which is '$delay' number of business days from today lol, math */ if(($current_day+$delay) > 5) return (((min($current_day, 5)+($delay-1))%5)+1); else return $delay; } function f($current_day, $delay) { return (((min($current_day, 5)+($delay-1))%5)+1); } for($i = 1; $i < 8; $i++) printf("\tf(%d, 1) => %d\n", $i, f($i, 1)); printf("\n\n\n\n"); for($i = 1; $i < 8; $i++) printf("\tf(%d, 2) => %d\n", $i, f($i, 2));

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.55
8.3.50.0090.00921.94
8.3.40.0070.01018.84
8.3.30.0060.00919.14
8.3.20.0040.00420.30
8.3.10.0040.00420.48
8.3.00.0080.00019.13
8.2.180.0060.01216.38
8.2.170.0140.00722.96
8.2.160.0040.01120.45
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00422.29
8.2.110.0060.00322.24
8.2.100.0040.00717.91
8.2.90.0040.00419.11
8.2.80.0040.00417.97
8.2.70.0070.00317.48
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0060.00318.21
8.2.30.0040.00419.44
8.2.20.0030.00617.73
8.2.10.0000.00818.00
8.2.00.0040.00417.67
8.1.280.0090.00925.92
8.1.270.0060.00322.05
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00023.78
8.1.230.0070.00319.08
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0050.00318.57
8.1.160.0030.00321.95
8.1.150.0000.00718.83
8.1.140.0000.01017.29
8.1.130.0000.00717.82
8.1.120.0000.00717.44
8.1.110.0040.00417.39
8.1.100.0000.00717.41
8.1.90.0050.00317.36
8.1.80.0040.00417.36
8.1.70.0000.00817.39
8.1.60.0030.00617.58
8.1.50.0000.00817.41
8.1.40.0080.00017.48
8.1.30.0030.00517.54
8.1.20.0000.00717.63
8.1.10.0030.00517.55
8.1.00.0030.00617.46
8.0.300.0000.00718.77
8.0.290.0070.00016.88
8.0.280.0000.00718.51
8.0.270.0070.00017.25
8.0.260.0080.00017.23
8.0.250.0070.00016.85
8.0.240.0030.00516.83
8.0.230.0020.00516.83
8.0.220.0000.00716.90
8.0.210.0030.00316.89
8.0.200.0020.00516.94
8.0.190.0090.00016.93
8.0.180.0040.00416.97
8.0.170.0000.00816.84
8.0.160.0000.00716.84
8.0.150.0050.00216.88
8.0.140.0000.00816.73
8.0.130.0060.00013.23
8.0.120.0000.00816.87
8.0.110.0040.00416.75
8.0.100.0040.00416.70
8.0.90.0000.00716.77
8.0.80.0030.01216.81
8.0.70.0000.00816.79
8.0.60.0080.00016.78
8.0.50.0000.00716.86
8.0.30.0070.01217.06
8.0.20.0100.00917.40
8.0.10.0040.00417.08
8.0.00.0100.01016.74
7.4.330.0060.00015.00
7.4.320.0070.00016.44
7.4.300.0000.00616.62
7.4.290.0030.00316.60
7.4.280.0000.00816.50
7.4.270.0030.00316.55
7.4.260.0080.00016.56
7.4.250.0000.00716.49
7.4.240.0040.00316.55
7.4.230.0050.00216.59
7.4.220.0070.01116.63
7.4.210.0030.01016.39
7.4.200.0000.00716.49
7.4.160.0160.00016.39
7.4.150.0130.00617.40
7.4.140.0090.00917.86
7.4.130.0090.00716.53
7.4.120.0110.00616.49
7.4.110.0100.00716.38
7.4.100.0100.00716.70
7.4.90.0090.00816.47
7.4.80.0070.01019.39
7.4.70.0090.00916.58
7.4.60.0110.00716.40
7.4.50.0000.00816.58
7.4.40.0070.01816.27
7.4.30.0090.00616.54
7.4.00.0100.00715.10
7.3.330.0030.00313.29
7.3.320.0040.00013.32
7.3.310.0040.00416.13
7.3.300.0030.00316.15
7.3.290.0120.00316.29
7.3.280.0050.01116.30
7.3.270.0140.00317.40
7.3.260.0090.01116.27
7.3.250.0040.01616.43
7.3.240.0080.00816.58
7.3.230.0000.01616.69
7.3.210.0100.00716.46
7.3.200.0110.01119.39
7.3.190.0090.01116.32
7.3.180.0060.01016.38
7.3.170.0120.00416.45
7.3.160.0060.01016.46
7.3.120.0090.00614.88
7.3.110.0050.00514.55
7.3.100.0000.01314.88
7.3.90.0090.00314.93
7.3.80.0030.01214.52
7.3.70.0000.01114.97
7.3.60.0030.01414.81
7.3.50.0100.00714.89
7.3.40.0040.01114.80
7.3.30.0030.01314.91
7.3.20.0100.00716.69
7.3.10.0050.01016.54
7.3.00.0030.01016.79
7.2.330.0100.01316.36
7.2.320.0140.00716.66
7.2.310.0060.01216.71
7.2.300.0050.01216.41
7.2.290.0100.01016.63
7.2.240.0030.01314.85
7.2.230.0030.01415.17
7.2.220.0070.00715.14
7.2.210.0000.01315.14
7.2.200.0060.00914.83
7.2.190.0000.01714.89
7.2.180.0030.00914.84
7.2.170.0030.00915.04
7.2.160.0100.00314.91
7.2.150.0130.00316.84
7.2.140.0110.00716.55
7.2.130.0040.00916.76
7.2.120.0120.00316.98
7.2.110.0070.00616.84
7.2.100.0050.01016.75
7.2.90.0070.00816.93
7.2.80.0090.00316.83
7.2.70.0050.00616.97
7.2.60.0060.00816.81
7.2.50.0060.00616.98
7.2.40.0020.01116.89
7.2.30.0060.00816.86
7.2.20.0070.01016.80
7.2.10.0070.00816.95
7.2.00.0040.00917.69
7.1.330.0070.01015.68
7.1.320.0070.00715.82
7.1.310.0040.00815.92
7.1.300.0080.00815.55
7.1.290.0030.01015.84
7.1.280.0060.00915.89
7.1.270.0000.01415.77
7.1.260.0070.00715.76
7.1.250.0050.00815.79
7.1.200.0040.00815.65
7.1.100.0000.00918.31
7.1.70.0030.00717.20
7.1.60.0090.01519.12
7.1.50.0070.01816.76
7.1.00.0000.08022.57
7.0.200.0000.00816.43
7.0.140.0100.06721.95
7.0.60.0100.07019.94
7.0.50.0100.04317.89
7.0.40.0070.04020.11
7.0.30.0570.06720.24
7.0.20.0370.07020.26
7.0.10.0000.08020.24
7.0.00.0170.06320.16
5.6.280.0100.06320.97
5.6.210.0170.07720.67
5.6.200.0070.04018.27
5.6.190.0100.08720.77
5.6.180.3700.04320.61
5.6.170.0530.04020.55
5.6.160.0070.08720.54
5.6.150.0070.08318.18
5.6.140.0200.06718.18
5.6.130.0070.07318.18
5.6.120.0100.04721.04
5.6.110.0100.07321.00
5.6.100.0030.07321.04
5.6.90.0000.07021.13
5.6.80.0030.06020.29
5.6.70.4700.03020.41
5.5.350.0030.03720.47
5.5.340.0170.03717.95
5.5.330.0030.06720.40
5.5.320.0400.05020.20
5.5.310.0270.08320.20
5.5.300.0030.05018.07
5.5.290.0030.04017.94
5.5.280.0100.07720.85
5.5.270.0070.08320.80
5.5.260.0170.07320.87
5.5.250.0130.07020.57
5.5.240.0030.07720.28
5.4.450.0230.05019.65
5.4.440.0330.05019.55
5.4.430.1000.04319.52
5.4.420.0570.03719.45
5.4.410.0470.04719.45
5.4.400.0300.04319.45
5.4.390.0370.04019.45
5.4.380.0530.06018.66
5.4.370.0370.07018.80
5.4.360.0330.05718.56
5.4.350.0330.05018.62
5.4.340.0500.05318.80
5.4.320.0080.04012.51
5.4.310.0050.05012.50
5.4.300.0050.03912.50
5.4.290.0130.04212.50
5.4.280.0070.04512.39
5.4.270.0060.03712.40
5.4.260.0050.03812.40
5.4.250.0080.03612.40
5.4.240.0070.03512.39
5.4.230.0070.03812.39
5.4.220.0060.03612.39
5.4.210.0040.03812.39
5.4.200.0070.03712.39
5.4.190.0040.03812.39
5.4.180.0050.03812.39
5.4.170.0120.04012.39
5.4.160.0040.04112.39
5.4.150.0080.03512.39
5.4.140.0060.04012.07
5.4.130.0080.03612.05
5.4.120.0050.04512.02
5.4.110.0050.04012.01
5.4.100.0030.04112.01
5.4.90.0060.04112.02
5.4.80.0030.03812.02
5.4.70.0070.03212.01
5.4.60.0040.03512.01
5.4.50.0060.03512.00
5.4.40.0050.03512.00
5.4.30.0110.02912.00
5.4.20.0050.04012.00
5.4.10.0040.03511.99
5.4.00.0040.03611.48
5.3.290.0030.04912.80
5.3.280.0090.05112.71
5.3.270.0080.03912.72
5.3.260.0070.03912.72
5.3.250.0070.04712.72
5.3.240.0040.04312.72
5.3.230.0040.04312.71
5.3.220.0070.03612.68
5.3.210.0080.03612.68
5.3.200.0040.03812.68
5.3.190.0070.03712.68
5.3.180.0080.03812.67
5.3.170.0060.03512.67
5.3.160.0060.03512.68
5.3.150.0040.03812.67
5.3.140.0060.03612.66
5.3.130.0080.03712.66
5.3.120.0080.03712.65
5.3.110.0050.04012.66
5.3.100.0040.03912.12
5.3.90.0100.04812.10
5.3.80.0080.03312.09
5.3.70.0020.04012.09
5.3.60.0070.03412.09
5.3.50.0040.03712.03
5.3.40.0070.03912.03
5.3.30.0060.03711.98
5.3.20.0080.03211.77
5.3.10.0050.03411.73
5.3.00.0110.03111.72
5.2.170.0030.0319.22
5.2.160.0090.0379.23
5.2.150.0030.0319.22
5.2.140.0050.0399.22
5.2.130.0050.0329.18
5.2.120.0070.0249.18
5.2.110.0100.0319.19
5.2.100.0050.0319.18
5.2.90.0030.0389.18
5.2.80.0070.0389.17
5.2.70.0050.0339.18
5.2.60.0020.0339.13
5.2.50.0050.0389.10
5.2.40.0080.0319.08
5.2.30.0040.0299.05
5.2.20.0070.0439.04
5.2.10.0030.0368.95
5.2.00.0070.0308.81
5.1.60.0020.0268.09
5.1.50.0020.0268.09
5.1.40.0030.0328.07
5.1.30.0060.0248.43
5.1.20.0030.0288.45
5.1.10.0030.0268.17
5.1.00.0030.0268.16
5.0.50.0040.0196.64
5.0.40.0060.0256.50
5.0.30.0040.0316.32
5.0.20.0030.0196.29
5.0.10.0030.0196.26
5.0.00.0030.0326.25
4.4.90.0030.0174.78
4.4.80.0050.0124.75
4.4.70.0030.0154.75
4.4.60.0020.0154.76
4.4.50.0010.0194.77
4.4.40.0020.0274.71
4.4.30.0020.0154.76
4.4.20.0030.0144.85
4.4.10.0030.0314.85
4.4.00.0020.0344.76
4.3.110.0030.0214.67
4.3.100.0050.0124.66
4.3.90.0020.0164.63
4.3.80.0020.0254.59
4.3.70.0060.0154.63
4.3.60.0020.0144.63
4.3.50.0030.0294.63
4.3.40.0040.0304.54
4.3.30.0030.0143.31
4.3.20.0020.0153.29
4.3.10.0030.0193.24
4.3.00.0070.01319.45

preferences:
38.19 ms | 401 KiB | 5 Q