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 abs((7+(((min($current_day, 5)+($delay-1))%5)+1)) - $current_day); else return $delay; } function f($current_day, $delay) { return abs((7+(((min($current_day, 5)+($delay-1))%5)+1)) - $current_day); } 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.70.0070.00718.30
8.3.60.0090.00618.55
8.3.50.0190.01021.96
8.3.40.0110.00418.71
8.3.30.0110.00719.08
8.3.20.0040.00420.16
8.3.10.0030.00520.57
8.3.00.0040.00419.09
8.2.180.0090.00616.38
8.2.170.0210.00022.96
8.2.160.0120.00320.17
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00822.13
8.2.110.0090.00022.02
8.2.100.0040.00720.35
8.2.90.0000.00819.23
8.2.80.0060.00317.97
8.2.70.0090.00017.63
8.2.60.0000.00917.80
8.2.50.0030.00718.07
8.2.40.0030.00518.22
8.2.30.0040.00419.43
8.2.20.0040.00417.61
8.2.10.0030.00517.94
8.2.00.0080.00017.75
8.1.280.0070.01125.92
8.1.270.0040.00423.96
8.1.260.0070.00026.35
8.1.250.0110.00328.09
8.1.240.0030.00623.81
8.1.230.0040.00719.17
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0120.00317.23
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0000.00818.52
8.1.160.0080.00022.01
8.1.150.0000.00818.75
8.1.140.0000.00717.30
8.1.130.0030.00317.93
8.1.120.0050.00317.46
8.1.110.0000.00817.46
8.1.100.0080.00017.44
8.1.90.0040.00417.31
8.1.80.0050.00217.46
8.1.70.0030.00317.38
8.1.60.0090.00017.58
8.1.50.0050.00317.51
8.1.40.0000.00817.55
8.1.30.0080.00017.66
8.1.20.0040.00417.63
8.1.10.0070.00017.49
8.1.00.0050.00217.33
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.46
8.0.270.0030.00317.31
8.0.260.0000.00717.21
8.0.250.0070.00016.93
8.0.240.0040.00417.03
8.0.230.0030.00316.95
8.0.220.0030.00316.89
8.0.210.0000.00816.79
8.0.200.0030.00316.85
8.0.190.0000.01016.83
8.0.180.0000.00716.95
8.0.170.0000.00816.84
8.0.160.0040.00416.89
8.0.150.0000.00716.81
8.0.140.0000.00716.87
8.0.130.0030.00313.26
8.0.120.0000.00716.82
8.0.110.0020.00516.72
8.0.100.0040.00416.79
8.0.90.0040.00416.72
8.0.80.0120.00616.95
8.0.70.0040.00416.96
8.0.60.0000.00816.96
8.0.50.0040.00416.78
8.0.30.0100.00817.09
8.0.20.0140.00617.41
8.0.10.0000.00716.98
8.0.00.0080.01316.73
7.4.330.0030.00315.00
7.4.320.0060.00016.36
7.4.300.0060.00016.52
7.4.290.0000.00616.52
7.4.280.0040.00416.61
7.4.270.0000.00716.64
7.4.260.0040.00316.61
7.4.250.0030.00316.58
7.4.240.0030.00416.54
7.4.230.0050.00316.69
7.4.220.0120.00616.59
7.4.210.0080.00516.65
7.4.200.0070.00016.41
7.4.160.0080.00816.46
7.4.150.0130.01317.40
7.4.140.0100.00817.86
7.4.130.0110.00716.49
7.4.120.0100.00816.50
7.4.110.0070.01016.39
7.4.100.0160.00316.55
7.4.90.0070.01116.44
7.4.80.0100.01019.39
7.4.70.0170.00016.48
7.4.60.0080.01116.41
7.4.50.0030.00516.77
7.4.40.0040.01316.52
7.4.30.0110.00616.67
7.4.00.0120.00315.02
7.3.330.0000.00713.34
7.3.320.0040.00413.14
7.3.310.0030.00316.36
7.3.300.0070.00016.32
7.3.290.0110.00716.31
7.3.280.0080.00816.29
7.3.270.0150.00517.40
7.3.260.0100.01016.60
7.3.250.0110.01316.41
7.3.240.0040.01316.64
7.3.230.0060.01016.40
7.3.210.0140.00316.61
7.3.200.0060.01119.39
7.3.190.0150.00716.51
7.3.180.0080.00816.55
7.3.170.0000.01616.57
7.3.160.0030.01316.59
7.2.330.0100.01216.81
7.2.320.0180.00716.25
7.2.310.0030.01416.69
7.2.300.0140.00316.68
7.2.290.0110.00816.46
7.2.00.0060.00619.43
7.1.100.0060.00918.34
7.1.70.0000.00917.19
7.1.60.0070.01819.12
7.1.50.0100.01417.02
7.1.00.0030.07722.30
7.0.200.0030.00716.83
7.0.140.0070.07022.14
7.0.60.0130.07319.93
7.0.50.0100.05317.91
7.0.40.0030.04320.27
7.0.30.0570.06720.16
7.0.20.0300.05020.16
7.0.10.0130.06720.19
7.0.00.0070.08020.12
5.6.210.0030.04320.61
5.6.200.0030.04318.12
5.6.190.0000.05320.49
5.6.180.3530.03720.52
5.6.170.0300.07320.48
5.6.160.0130.03720.59
5.6.150.0000.06718.30
5.6.140.0200.05318.15
5.6.130.0070.04018.27
5.6.120.0030.04321.14
5.6.110.0030.09321.09
5.6.100.0070.08321.12
5.6.90.0100.07020.98
5.6.80.0100.04020.43
5.6.70.4530.03320.51
5.5.350.0000.03320.36
5.5.340.0030.04317.97
5.5.330.0170.07720.34
5.5.320.0400.07020.51
5.5.310.0230.07720.41
5.5.300.0070.04317.98
5.5.290.0030.08017.98
5.5.280.0100.07320.89
5.5.270.0070.04020.88
5.5.260.0070.08320.87
5.5.250.0070.08720.59
5.5.240.0070.06020.16
5.4.450.0330.05019.45
5.4.440.0270.05319.45
5.4.430.0300.05019.45
5.4.420.0330.04019.45
5.4.410.0370.04719.45
5.4.400.0600.03319.45
5.4.390.0330.04319.45
5.4.380.0470.07018.79
5.4.370.0300.05018.50
5.4.360.0300.04718.85
5.4.350.0300.06318.54
5.4.340.0400.06018.79
5.4.320.0050.03612.51
5.4.310.0040.04212.50
5.4.300.0030.03812.51
5.4.290.0070.03512.50
5.4.280.0050.03612.40
5.4.270.0060.03512.40
5.4.260.0070.03612.41
5.4.250.0070.03512.41
5.4.240.0030.04112.41
5.4.230.0040.04112.39
5.4.220.0110.03912.39
5.4.210.0060.03612.40
5.4.200.0070.03612.39
5.4.190.0050.03912.39
5.4.180.0080.03212.39
5.4.170.0040.03612.40
5.4.160.0040.03712.39
5.4.150.0030.03912.39
5.4.140.0050.03712.08
5.4.130.0040.04012.07
5.4.120.0060.03912.02
5.4.110.0040.04212.02
5.4.100.0060.03412.02
5.4.90.0090.04012.01
5.4.80.0050.03712.02
5.4.70.0050.03512.02
5.4.60.0050.03612.02
5.4.50.0060.03812.01
5.4.40.0080.03712.00
5.4.30.0060.03912.00
5.4.20.0070.03812.00
5.4.10.0060.03312.00
5.4.00.0040.03711.49
5.3.290.0090.04112.80
5.3.280.0020.04112.71
5.3.270.0040.04012.72
5.3.260.0100.03312.72
5.3.250.0050.04112.72
5.3.240.0070.04012.72
5.3.230.0050.03712.71
5.3.220.0070.03412.68
5.3.210.0070.03612.68
5.3.200.0080.03412.68
5.3.190.0070.03612.67
5.3.180.0090.03812.68
5.3.170.0080.03412.67
5.3.160.0050.03612.68
5.3.150.0070.03512.68
5.3.140.0050.03612.66
5.3.130.0100.04312.66
5.3.120.0030.04112.66
5.3.110.0050.03912.66
5.3.100.0080.03412.12
5.3.90.0070.03412.10
5.3.80.0050.03712.09
5.3.70.0100.03212.09
5.3.60.0050.03712.08
5.3.50.0040.03712.03
5.3.40.0030.03912.03
5.3.30.0090.03611.99
5.3.20.0050.03511.77
5.3.10.0130.03311.73
5.3.00.0060.03911.72
5.2.170.0060.0309.23
5.2.160.0040.0309.22
5.2.150.0030.0319.22
5.2.140.0040.0309.22
5.2.130.0030.0309.18
5.2.120.0030.0299.18
5.2.110.0040.0299.18
5.2.100.0040.0299.19
5.2.90.0030.0299.19
5.2.80.0040.0309.18
5.2.70.0070.0279.18
5.2.60.0060.0299.14
5.2.50.0040.0319.11
5.2.40.0030.0339.08
5.2.30.0030.0319.05
5.2.20.0020.0319.04
5.2.10.0050.0278.95
5.2.00.0050.0288.82
5.1.60.0030.0248.09
5.1.50.0020.0268.09
5.1.40.0040.0248.07
5.1.30.0040.0268.42
5.1.20.0060.0248.45
5.1.10.0050.0248.17
5.1.00.0070.0228.17
5.0.50.0020.0236.65
5.0.40.0040.0186.51
5.0.30.0030.0316.32
5.0.20.0030.0206.29
5.0.10.0030.0196.27
5.0.00.0020.0316.25
4.4.90.0030.0154.78
4.4.80.0040.0144.76
4.4.70.0060.0124.75
4.4.60.0010.0174.75
4.4.50.0030.0154.77
4.4.40.0020.0264.71
4.4.30.0050.0134.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0060.0224.76
4.3.110.0040.0154.67
4.3.100.0010.0164.66
4.3.90.0030.0144.64
4.3.80.0010.0264.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0010.0164.63
4.3.40.0030.0294.54
4.3.30.0030.0153.31
4.3.20.0020.0163.29
4.3.10.0040.0133.25
4.3.00.0000.01719.45

preferences:
44.6 ms | 401 KiB | 5 Q