3v4l.org

run code in 300+ PHP versions simultaneously
<?php function percentYear($a, $b) { //A rather complex function that calculates the difference between two dates in terms of the year that they're in. //Returns a number that corresponds to the amount of years between the two provided dates. //Takes in two dates and returns the decimal of days per year for that specific year // I made this in order to fix the issue of leap years. if(strtotime($a)<strtotime($b)){ list($a, $b) = array($b, $a); } $aYearDay = date("z", strtotime($a)) + 1; $aYearDays = date("z", strtotime(date("Y", strtotime($a))."-12-31")) + 1; $aPercent = $aYearDay/$aYearDays; $bYearDay = date("z", strtotime($b)) + 1; $bYearDays = date("z", strtotime(date("Y", strtotime($b))."-12-31")) + 1; $bPercent = $bYearDay/$bYearDays; if(date("Y", strtotime($a))!=date("Y", strtotime($b))) { $aPercent += abs(date("Y", strtotime($a))-date("Y", strtotime($b))); } return abs($aPercent-$bPercent); } echo percentYear('2014-03-14', '2014-02-14');

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.58
8.3.50.0060.01122.18
8.3.40.0090.00618.98
8.3.30.0090.00918.77
8.3.20.0030.00618.85
8.3.10.0040.00420.77
8.3.00.0050.00323.62
8.2.180.0120.00316.38
8.2.170.0070.01322.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00819.74
8.2.110.0000.01020.57
8.2.100.0000.01217.97
8.2.90.0040.00419.35
8.2.80.0040.00417.97
8.2.70.0030.00717.75
8.2.60.0040.00418.03
8.2.50.0040.00418.07
8.2.40.0000.00718.22
8.2.30.0080.00019.77
8.2.20.0000.00817.86
8.2.10.0060.00318.02
8.2.00.0000.00717.94
8.1.280.0070.01425.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00622.02
8.1.230.0080.00417.70
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0090.00017.61
8.1.190.0000.00817.52
8.1.180.0000.00818.10
8.1.170.0040.00418.86
8.1.160.0040.00418.93
8.1.150.0000.00718.90
8.1.140.0040.00417.69
8.1.130.0030.00317.77
8.1.120.0000.00717.65
8.1.110.0060.00317.66
8.1.100.0030.00417.68
8.1.90.0020.00517.57
8.1.80.0040.00417.70
8.1.70.0030.00317.64
8.1.60.0040.00417.77
8.1.50.0000.00817.51
8.1.40.0080.00017.57
8.1.30.0040.00417.72
8.1.20.0030.00617.78
8.1.10.0040.00417.72
8.1.00.0030.00517.54
8.0.300.0000.00718.77
8.0.290.0070.00017.00
8.0.280.0070.00018.40
8.0.270.0030.00317.26
8.0.260.0040.00417.09
8.0.250.0000.00817.11
8.0.240.0070.00317.20
8.0.230.0040.00417.10
8.0.220.0020.00517.14
8.0.210.0070.00017.17
8.0.200.0000.00717.09
8.0.190.0030.00517.15
8.0.180.0040.00417.16
8.0.170.0050.00317.04
8.0.160.0030.00617.19
8.0.150.0000.00817.08
8.0.140.0040.00417.17
8.0.130.0090.00013.52
8.0.120.0040.00417.16
8.0.110.0050.00316.95
8.0.100.0000.00817.04
8.0.90.0040.00417.12
8.0.80.0040.01117.16
8.0.70.0040.00416.98
8.0.60.0050.00317.13
8.0.50.0040.00417.10
8.0.30.0090.00817.40
8.0.20.0130.00517.40
8.0.10.0050.00317.18
8.0.00.0140.00617.06
7.4.330.0020.00214.81
7.4.320.0000.00816.76
7.4.300.0000.00616.55
7.4.290.0030.00316.75
7.4.280.0050.00316.74
7.4.270.0000.00816.75
7.4.260.0030.00313.29
7.4.250.0000.00916.63
7.4.240.0070.00016.66
7.4.230.0070.00016.50
7.4.220.0060.01316.59
7.4.210.0070.00816.76
7.4.200.0000.00716.76
7.4.190.0040.00416.61
7.4.160.0110.00716.73
7.4.150.0120.00617.40
7.4.140.0090.01217.86
7.4.130.0030.01416.77
7.4.120.0110.00616.67
7.4.110.0120.01116.83
7.4.100.0110.00616.75
7.4.90.0060.01616.66
7.4.80.0130.00719.04
7.4.70.0040.01416.71
7.4.60.0090.00616.86
7.4.50.0060.00016.45
7.4.40.0100.00522.27
7.4.30.0000.01616.93
7.4.10.0020.01715.14
7.4.00.0060.01215.15
7.3.330.0050.00013.43
7.3.320.0000.00613.50
7.3.310.0070.00016.47
7.3.300.0030.00316.39
7.3.290.0060.01216.52
7.3.280.0050.01116.53
7.3.270.0130.00317.40
7.3.260.0150.00518.24
7.3.250.0150.00716.59
7.3.240.0130.01016.81
7.3.230.0100.00716.43
7.3.210.0360.01816.48
7.3.200.0100.01019.39
7.3.190.0070.01416.87
7.3.180.0080.00916.44
7.3.170.0070.02116.58
7.3.160.0110.01216.55
7.3.130.0090.00715.11
7.3.120.0050.01115.09
7.3.110.0080.00915.04
7.3.100.0040.00914.92
7.3.90.0020.01215.08
7.3.80.0000.01114.83
7.3.70.0090.00514.91
7.3.60.0100.00615.02
7.3.50.0050.00815.04
7.3.40.0090.00514.90
7.3.30.0040.00714.82
7.3.20.0070.00216.86
7.3.10.0110.00316.72
7.3.00.0030.00916.78
7.2.330.0100.01316.85
7.2.320.0040.01216.72
7.2.310.0140.00616.74
7.2.300.0120.00616.90
7.2.290.0060.01116.66
7.2.260.0050.01115.25
7.2.250.0020.01515.12
7.2.240.0100.00615.00
7.2.230.0080.00815.31
7.2.220.0100.00415.33
7.2.210.0040.01115.05
7.2.200.0050.00915.16
7.2.190.0050.01015.23
7.2.180.0050.00515.21
7.2.170.0080.00515.19
7.2.160.0030.01215.13
7.2.150.0030.01016.92
7.2.140.0050.00617.15
7.2.130.0090.00317.19
7.2.120.0050.00917.02
7.2.110.0030.00717.00
7.2.100.0110.00117.03
7.2.90.0070.00417.02
7.2.80.0130.00216.95
7.2.70.0050.01116.99
7.2.60.0060.00816.97
7.2.50.0110.00316.91
7.2.40.0130.00317.01
7.2.30.0090.00217.18
7.2.20.0060.00617.06
7.2.10.0090.00517.05
7.2.00.0040.01217.81
7.1.330.0040.01015.90
7.1.320.0060.00815.86
7.1.310.0020.01215.90
7.1.300.0070.00815.69
7.1.290.0030.00715.73
7.1.280.0040.00815.88
7.1.270.0030.00915.91
7.1.260.0010.00915.85
7.1.250.0080.00315.81
7.1.240.0030.01115.98
7.1.230.0030.01115.90
7.1.220.0050.00915.84
7.1.210.0040.00415.99
7.1.200.0080.00615.98
7.1.190.0030.00816.02
7.1.180.0080.00515.76
7.1.170.0080.00515.78
7.1.160.0060.00815.96
7.1.150.0060.00715.97
7.1.140.0020.01115.84
7.1.130.0060.00815.90
7.1.120.0040.01215.84
7.1.110.0050.00515.88
7.1.100.0030.00816.63
7.1.90.0020.00815.86
7.1.80.0050.00715.65
7.1.70.0020.01016.24
7.1.60.0080.01017.17
7.1.50.0100.01022.38
7.1.40.0030.01015.96
7.1.30.0080.00515.73
7.1.20.0060.00615.86
7.1.10.0080.00515.86
7.1.00.0030.01918.19
7.0.330.0090.00315.61
7.0.320.0050.00915.44
7.0.310.0110.00515.52
7.0.300.0080.00615.46
7.0.290.0070.00615.66
7.0.280.0080.00215.42
7.0.270.0070.00715.35
7.0.260.0050.00915.38
7.0.250.0010.00915.40
7.0.240.0080.00415.48
7.0.230.0060.00615.66
7.0.220.0090.00515.60
7.0.210.0070.00915.59
7.0.200.0020.01116.08
7.0.190.0090.00715.53
7.0.180.0050.00815.48
7.0.170.0040.00915.42
7.0.160.0070.00715.49
7.0.150.0070.00715.66
7.0.140.0090.02617.73
7.0.130.0000.01215.46
7.0.120.0080.00315.66
7.0.110.0000.01115.55
7.0.100.0130.02117.08
7.0.90.0050.02217.02
7.0.80.0080.02416.96
7.0.70.0050.02216.92
7.0.60.0050.02217.10
7.0.50.0160.03317.13
7.0.40.0070.02915.81
7.0.30.0080.03315.65
7.0.20.0070.03515.64
7.0.10.0070.01915.81
7.0.00.0080.03215.77
5.6.400.0030.00614.45
5.6.390.0060.00514.82
5.6.380.0050.00714.18
5.6.370.0070.01114.56
5.6.360.0100.00314.59
5.6.350.0040.01014.65
5.6.340.0070.00514.51
5.6.330.0060.01114.52
5.6.320.0070.00714.58
5.6.310.0070.00714.63
5.6.300.0070.00514.46
5.6.290.0040.00414.71
5.6.280.0030.03316.67
5.6.270.0080.00514.55
5.6.260.0040.00914.50
5.6.250.0070.01916.53
5.6.240.0080.02016.62
5.6.230.0070.03016.48
5.6.220.0070.02216.52
5.6.210.0050.03116.51
5.6.200.0060.02616.71
5.6.190.0080.03116.72
5.6.180.0050.03216.68
5.6.170.0110.03016.65
5.6.160.0090.03216.79
5.6.150.0110.02816.59
5.6.140.0080.03216.71
5.6.130.0080.02116.76
5.6.120.0060.02216.70
5.6.110.0070.03416.84
5.6.100.0060.02116.68
5.6.90.0040.01916.64
5.6.80.0080.01716.38
5.6.70.0030.03416.28
5.6.60.0080.02716.35
5.6.50.0060.02216.36
5.6.40.0070.02916.39
5.6.30.0080.02816.34
5.6.20.0130.01316.36
5.6.10.0050.03116.47
5.6.00.0100.02416.34
5.5.380.0030.02716.32
5.5.370.0090.03116.54
5.5.360.0030.03516.38
5.5.350.0060.03316.49
5.5.340.0080.03216.62
5.5.330.0140.01416.61
5.5.320.0090.02716.58
5.5.310.0120.03016.39
5.5.300.0080.03116.51
5.5.290.0030.03416.63
5.5.280.0100.02816.60
5.5.270.0040.02416.46
5.5.260.0040.03616.61
5.5.250.0050.03216.52
5.5.240.0080.03016.20
5.5.230.0080.03216.29
5.5.220.0110.02616.13
5.5.210.0120.02516.34
5.5.200.0070.02316.30
5.5.190.0080.02816.24
5.5.180.0060.03316.22
5.5.170.0060.00914.35
5.5.160.0080.01816.28
5.5.150.0030.02416.34
5.5.140.0060.02616.34
5.5.130.0060.01816.36
5.5.120.0110.01416.29
5.5.110.0060.01916.35
5.5.100.0090.02116.29
5.5.90.0070.01716.23
5.5.80.0090.01316.19
5.5.70.0070.02016.19
5.5.60.0050.01616.20
5.5.50.0060.02016.22
5.5.40.0040.02216.30
5.5.30.0060.01716.25
5.5.20.0020.02116.41
5.5.10.0080.01816.20
5.5.00.0030.02116.11
5.4.450.0060.03014.83
5.4.440.0030.03214.82
5.4.430.0070.02814.90
5.4.420.0050.02914.89
5.4.410.0080.02514.88
5.4.400.0050.03014.78
5.4.390.0070.02914.81
5.4.380.0030.03114.75
5.4.370.0050.02814.78
5.4.360.0040.03014.73
5.4.350.0010.02514.81
5.4.340.0020.03014.73
5.4.330.0020.00912.65
5.4.320.0050.02914.72
5.4.310.0090.02314.83
5.4.300.0090.02714.72
5.4.290.0030.02914.80
5.4.280.0040.03014.80
5.4.270.0060.01714.81
5.4.260.0050.01514.78
5.4.250.0060.01614.77
5.4.240.0060.01714.80
5.4.230.0060.01614.72
5.4.220.0020.02214.79
5.4.210.0050.02714.80
5.4.200.0030.02114.73
5.4.190.0050.02414.82
5.4.180.0040.01614.81
5.4.170.0030.01814.81
5.4.160.0080.01414.74
5.4.150.0070.01514.71
5.4.140.0070.02613.91
5.4.130.0030.02113.91
5.4.120.0030.02513.90
5.4.110.0040.02213.94
5.4.100.0040.01913.87
5.4.90.0050.01313.89
5.4.80.0030.01813.87
5.4.70.0050.01913.92
5.4.60.0060.01413.85
5.4.50.0020.01613.90
5.4.40.0020.01613.90
5.4.30.0040.02013.91
5.4.20.0030.01813.87
5.4.10.0060.01513.90
5.4.00.0010.02013.70
5.3.290.0010.02913.36
5.3.280.0060.01713.34
5.3.270.0030.01713.34
5.3.260.0070.01713.34
5.3.250.0040.02513.34
5.3.240.0020.01813.34
5.3.230.0060.02813.34
5.3.220.0030.02013.34
5.3.210.0010.03113.34
5.3.200.0050.01613.34
5.3.190.0040.01813.34
5.3.180.0030.01713.34
5.3.170.0040.01813.34
5.3.160.0030.01713.34
5.3.150.0060.01313.34
5.3.140.0020.01813.34
5.3.130.0030.01713.34
5.3.120.0020.01913.34
5.3.110.0040.01913.34
5.3.100.0020.01513.34
5.3.90.0000.01913.34
5.3.80.0040.01613.34
5.3.70.0060.01413.34
5.3.60.0040.02713.34
5.3.50.0020.01813.34
5.3.40.0050.01513.34
5.3.30.0020.01813.34
5.3.20.0070.01213.34
5.3.10.0020.01613.34
5.3.00.0020.01713.34
5.2.170.0000.03314.72
5.2.160.0000.03314.72
5.2.150.0070.02714.72
5.2.140.0000.03314.72
5.2.130.0030.03014.72
5.2.120.0000.03014.72
5.2.110.0030.03714.72
5.2.100.0030.03014.72
5.2.90.0030.05014.72
5.2.80.0030.02714.72
5.2.70.0070.02314.72
5.2.60.0170.04714.72
5.2.50.0100.06014.72
5.2.40.0000.02714.72
5.2.30.0000.03014.72
5.2.20.0000.05014.72
5.2.10.0070.02714.72
5.2.00.0000.03014.72
5.1.60.0000.04014.72
5.1.50.0030.05714.72
5.1.40.0000.03014.72
5.1.30.0030.04014.72
5.1.20.0030.02714.72
5.1.10.0000.05714.72
5.1.00.0070.04714.72
5.0.50.0030.04314.72
5.0.40.0070.02014.72
5.0.30.0000.06014.72
5.0.20.0000.05014.72
5.0.10.0030.02714.72
5.0.00.0030.03714.72
4.4.90.0000.01314.72
4.4.80.0000.01714.72
4.4.70.0000.02014.72
4.4.60.0030.03714.72
4.4.50.0000.02714.72
4.4.40.0030.05014.72
4.4.30.0070.02314.72
4.4.20.0000.03714.72
4.4.10.0030.03714.72
4.4.00.0000.05314.72
4.3.110.0030.03314.72
4.3.100.0000.02714.72
4.3.90.0030.03314.72
4.3.80.0100.04314.72
4.3.70.0070.03014.72
4.3.60.0000.03714.72
4.3.50.0070.02714.72
4.3.40.0030.03014.72
4.3.30.0000.03714.72
4.3.20.0000.03014.72
4.3.10.0000.03714.72
4.3.00.0030.03314.72

preferences:
50.26 ms | 401 KiB | 5 Q