3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startYear = 2014; $currentYear = 2012; $lastTaken = 2012; $recurrenceYears = 3; $useYear = MAX($startYear, MIN($currentYear, $lastTaken)); $nextRequirement = $useYear + ($recurrenceYears - (($useYear - $startYear) % $recurrenceYears)); echo $nextRequirement;

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.0070.00718.30
8.3.50.0210.00021.07
8.3.40.0120.00318.64
8.3.30.0070.00718.89
8.3.20.0000.00720.39
8.3.10.0070.00023.62
8.3.00.0000.00819.13
8.2.180.0110.00425.92
8.2.170.0120.00322.96
8.2.160.0160.00320.39
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.01419.64
8.2.110.0000.00922.08
8.2.100.0040.00817.50
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0090.00018.05
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0080.00018.19
8.2.20.0040.00417.55
8.2.10.0040.00418.22
8.2.00.0040.00417.75
8.1.280.0070.01325.92
8.1.270.0030.00621.95
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00624.02
8.1.230.0070.00419.01
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0030.00618.50
8.1.160.0050.00221.95
8.1.150.0040.00418.86
8.1.140.0000.00717.38
8.1.130.0030.00317.70
8.1.120.0040.00417.38
8.1.110.0050.00317.38
8.1.100.0040.00417.30
8.1.90.0040.00417.29
8.1.80.0040.00417.34
8.1.70.0000.00617.34
8.1.60.0030.00617.52
8.1.50.0040.00417.45
8.1.40.0040.00417.48
8.1.30.0030.00517.54
8.1.20.0040.00417.58
8.1.10.0040.00417.40
8.1.00.0050.00517.40
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0030.00318.36
8.0.270.0030.00316.68
8.0.260.0030.00317.21
8.0.250.0030.00316.87
8.0.240.0040.00416.94
8.0.230.0030.00316.96
8.0.220.0000.00716.88
8.0.210.0000.00816.90
8.0.200.0030.00316.93
8.0.190.0030.00916.85
8.0.180.0030.00316.81
8.0.170.0000.00716.81
8.0.160.0000.00716.94
8.0.150.0040.00416.89
8.0.140.0040.00416.77
8.0.130.0000.00613.24
8.0.120.0000.00716.89
8.0.110.0040.00416.95
8.0.100.0070.00016.77
8.0.90.0070.00016.81
8.0.80.0120.00816.84
8.0.70.0000.00816.73
8.0.60.0030.00316.79
8.0.50.0080.00016.95
8.0.30.0090.01017.06
8.0.20.0140.00617.40
8.0.10.0000.00716.80
8.0.00.0050.01316.68
7.4.330.0030.00315.02
7.4.320.0000.00716.44
7.4.300.0030.00316.35
7.4.290.0040.00416.45
7.4.280.0000.00716.42
7.4.270.0030.00316.50
7.4.260.0070.00016.56
7.4.250.0040.00416.49
7.4.240.0050.00216.43
7.4.230.0030.00316.43
7.4.220.0100.01316.54
7.4.210.0090.00916.55
7.4.200.0000.00716.28
7.4.160.0100.01316.38
7.4.150.0110.00617.40
7.4.140.0090.00917.86
7.4.130.0080.00816.38
7.4.120.0060.01116.45
7.4.110.0070.01016.45
7.4.100.0130.00316.51
7.4.90.0120.00616.52
7.4.80.0180.00419.39
7.4.70.0160.00316.57
7.4.60.0090.00616.47
7.4.50.0000.00816.57
7.4.40.0090.00916.48
7.4.30.0090.00916.63
7.4.00.0110.00415.05
7.3.330.0000.00713.05
7.3.320.0000.00513.14
7.3.310.0030.00316.07
7.3.300.0060.00016.24
7.3.290.0060.00816.21
7.3.280.0090.00816.21
7.3.270.0140.00317.40
7.3.260.0030.01416.14
7.3.250.0100.00616.27
7.3.240.0040.01816.20
7.3.230.0090.00916.53
7.3.210.0000.01616.52
7.3.200.0060.01019.39
7.3.190.0120.00816.32
7.3.180.0030.01316.54
7.3.170.0190.00016.27
7.3.160.0070.01516.04
7.3.00.0000.01916.64
7.2.330.0100.01016.62
7.2.320.0080.01116.53
7.2.310.0130.00316.58
7.2.300.0120.00416.31
7.2.290.0060.01316.59
7.2.130.0030.01017.03
7.2.120.0030.00916.86
7.2.110.0060.00616.77
7.2.100.0060.00617.01
7.2.90.0030.01016.87
7.2.80.0030.01016.89
7.2.70.0030.00616.95
7.2.60.0000.00916.96
7.2.50.0100.00716.50
7.2.40.0030.01016.92
7.2.30.0030.01316.70
7.2.20.0040.01117.02
7.2.10.0090.00616.87
7.2.00.0000.01218.10
7.1.250.0000.01016.03
7.1.240.0070.00415.68
7.1.230.0060.00615.81
7.1.220.0040.00815.82
7.1.210.0060.00615.63
7.1.200.0140.00315.61
7.1.190.0030.01015.98
7.1.180.0060.00915.86
7.1.170.0000.01315.82
7.1.160.0040.00715.93
7.1.150.0080.00415.84
7.1.140.0000.01015.83
7.1.130.0040.01115.88
7.1.120.0040.00415.81
7.1.110.0070.00715.89
7.1.100.0040.01016.87
7.1.90.0060.00615.73
7.1.80.0000.01515.84
7.1.70.0020.00816.59
7.1.60.0070.01117.33
7.1.50.0070.01016.17
7.1.40.0080.00415.63
7.1.30.0060.00315.82
7.1.20.0120.00615.89
7.1.10.0070.00715.61
7.1.00.0050.04219.15
7.0.330.0000.00915.56
7.0.320.0060.00315.12
7.0.310.0040.00415.27
7.0.300.0070.00715.15
7.0.290.0030.01015.25
7.0.280.0140.00015.38
7.0.270.0030.00615.47
7.0.260.0030.00915.21
7.0.250.0000.01415.37
7.0.240.0020.00515.37
7.0.230.0050.00515.45
7.0.220.0070.00715.41
7.0.210.0030.00915.58
7.0.200.0040.00515.98
7.0.190.0000.01015.17
7.0.180.0040.00815.34
7.0.170.0030.00815.30
7.0.160.0080.00815.39
7.0.150.0070.00715.24
7.0.140.0030.04218.81
7.0.130.0000.00915.20
7.0.120.0060.00615.42
7.0.110.0000.01315.27
7.0.100.0060.00615.16
7.0.90.0030.00715.35
7.0.80.0030.00715.54
7.0.70.0050.00515.54
7.0.60.0040.03117.59
7.0.50.0100.03516.74
7.0.40.0150.04016.58
7.0.30.0190.03416.59
7.0.20.0150.04516.84
7.0.10.0050.03416.70
7.0.00.0050.05116.79
5.6.380.0060.01014.42
5.6.370.0070.00714.12
5.6.360.0070.00714.54
5.6.350.0000.01614.24
5.6.340.0090.00614.04
5.6.330.0070.00714.14
5.6.320.0040.01114.24
5.6.310.0040.00714.55
5.6.300.0060.00314.48
5.6.290.0070.00313.91
5.6.280.0070.00314.17
5.6.270.0040.00714.25
5.6.260.0040.00714.15
5.6.250.0040.00714.60
5.6.240.0030.00714.48
5.6.230.0040.00714.38
5.6.220.0110.00413.99
5.6.210.0090.02317.34
5.6.200.0130.02816.26
5.6.190.0080.04317.33
5.6.180.0120.04017.16
5.6.170.0500.02517.37
5.6.160.0080.04417.36
5.6.150.0080.04016.25
5.6.140.0090.04316.11
5.6.130.0070.04116.15
5.6.120.0100.02817.50
5.6.110.0070.04317.67
5.6.100.0050.03517.51
5.6.90.0030.03717.67
5.6.80.0030.04017.21
5.6.70.0080.00014.07
5.6.60.0080.00414.38
5.6.50.0000.01114.20
5.6.40.0030.00814.13
5.6.30.0090.00614.14
5.6.20.0000.00814.16
5.6.10.0000.01014.35
5.6.00.0090.00614.49
5.5.380.0030.00810.93
5.5.370.0000.00810.82
5.5.360.0000.01111.14
5.5.350.2130.02315.88
5.5.340.0020.03314.50
5.5.330.0070.04815.58
5.5.320.0180.03015.76
5.5.310.0100.02315.51
5.5.300.0070.03914.33
5.5.290.0090.04414.44
5.5.280.0070.03015.78
5.5.270.0070.04415.82
5.5.260.0070.03816.03
5.5.250.0080.03815.71
5.5.240.0110.03815.64
5.5.230.0030.00910.67
5.5.220.0060.00610.97
5.5.210.0000.01010.88
5.5.200.0030.00610.85
5.5.190.0060.00610.77
5.5.180.0040.00810.98
5.5.170.0060.00611.18
5.5.160.0060.00310.88
5.5.150.0050.00311.04
5.5.140.0040.00410.89
5.5.130.0030.00910.75
5.5.120.0050.00311.04
5.5.110.0030.00611.09
5.5.100.0070.00310.89
5.5.90.0040.00810.64
5.5.80.0020.00510.96
5.5.70.0070.00411.01
5.5.60.0030.00610.89
5.5.50.0050.00211.00
5.5.40.0100.00011.04
5.5.30.0050.00510.82
5.5.20.0050.00511.10
5.5.10.0000.01010.82
5.5.00.0070.00010.80
5.4.450.0350.03015.21
5.4.440.0330.03515.17
5.4.430.0390.03015.23
5.4.420.0090.02715.02
5.4.410.0220.03215.20
5.4.400.0330.03215.01
5.4.390.0370.03514.80
5.4.380.0330.03315.00
5.4.370.0310.03115.02
5.4.360.0380.03014.86
5.4.350.0300.02714.86
5.4.340.0080.01711.43
5.4.330.0090.00311.16
5.4.320.0050.02011.63
5.4.310.0050.02111.69
5.4.300.0010.02411.72
5.4.290.0060.02011.64
5.4.280.0030.02111.62
5.4.270.0080.01811.67
5.4.260.0070.02011.52
5.4.250.0050.02411.72
5.4.240.0050.02211.57
5.4.230.0070.02111.61
5.4.220.0050.02011.59
5.4.210.0060.02011.51
5.4.200.0060.01811.76
5.4.190.0080.01911.70
5.4.180.0020.02411.63
5.4.170.0050.02211.67
5.4.160.0040.02211.65
5.4.150.0050.02211.50
5.4.140.0030.02611.53
5.4.130.0040.02511.58
5.4.120.0050.02011.48
5.4.110.0050.02111.46
5.4.100.0040.02311.58
5.4.90.0020.02311.48
5.4.80.0050.02211.37
5.4.70.0040.02311.51
5.4.60.0050.02211.41
5.4.50.0060.02111.33
5.4.40.0040.02011.33
5.4.30.0060.02211.38
5.4.20.0040.02311.49
5.4.10.0020.02211.34
5.4.00.0030.02511.04
5.3.290.0080.01811.65
5.3.280.0040.02311.60
5.3.270.0020.02511.61
5.3.260.0040.02511.61
5.3.250.0070.01811.61
5.3.240.0040.02411.60
5.3.230.0060.02211.60
5.3.220.0040.02111.58
5.3.210.0070.02211.59
5.3.200.0050.02011.59
5.3.190.0060.02011.58
5.3.180.0050.02111.58
5.3.170.0050.02311.58
5.3.160.0060.01911.58
5.3.150.0030.02311.58
5.3.140.0040.02211.57
5.3.130.0040.02311.57
5.3.120.0040.02411.57
5.3.110.0060.02111.57
5.3.100.0080.01811.30
5.3.90.0020.02311.29
5.3.80.0060.02111.28
5.3.70.0070.01911.28
5.3.60.0040.02511.28
5.3.50.0020.02611.25
5.3.40.0050.02511.24
5.3.30.0060.02811.22
5.3.20.0050.02711.10
5.3.10.0050.02011.09
5.3.00.0050.02811.08
5.2.170.0040.0259.83
5.2.160.0040.0189.83
5.2.150.0070.0209.83
5.2.140.0070.0179.83
5.2.130.0060.0199.81
5.2.120.0050.0209.81
5.2.110.0070.0199.82
5.2.100.0060.0189.81
5.2.90.0030.0219.81
5.2.80.0070.0189.81
5.2.70.0060.0159.81
5.2.60.0060.0179.79
5.2.50.0050.0189.77
5.2.40.0060.0189.76
5.2.30.0070.0159.75
5.2.20.0020.0249.74
5.2.10.0060.0189.71
5.2.00.0060.0219.64
5.1.60.0020.0199.28
5.1.50.0070.0189.28
5.1.40.0050.0189.27
5.1.30.0020.0229.45
5.1.20.0050.0219.46
5.1.10.0040.0169.32
5.1.00.0020.0169.32
5.0.50.0050.0118.56
5.0.40.0060.0098.49
5.0.30.0040.0208.39
5.0.20.0040.0098.38
5.0.10.0040.0108.37
5.0.00.0040.0168.36
4.4.90.0030.0107.63
4.4.80.0020.0107.62
4.4.70.0030.0087.62
4.4.60.0040.0107.62
4.4.50.0040.0107.63
4.4.40.0020.0157.60
4.4.30.0040.0097.62
4.4.20.0020.0117.67
4.4.10.0060.0077.67
4.4.00.0020.0167.62
4.3.110.0010.0127.58
4.3.100.0030.0117.58
4.3.90.0020.0107.56
4.3.80.0010.0187.54
4.3.70.0030.0107.56
4.3.60.0020.0117.55
4.3.50.0010.0117.56
4.3.40.0010.0167.51
4.3.30.0020.0096.89
4.3.20.0030.0126.88
4.3.10.0020.0106.86
4.3.00.0120.0088.70

preferences:
45.98 ms | 401 KiB | 5 Q