3v4l.org

run code in 300+ PHP versions simultaneously
<?php function yearlyDays($a, $b) { //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. $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))) { //a percent is .6 in the year 2013 leap year //b percent is .7 in the year 2012 $aPercent += abs(date("Y", strtotime($a))-date("Y", strtotime($b))); } return $aPercent-$bPercent; } print yearlyDays("2013-05-12", "2012-05-12");

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.40.0040.01119.04
8.3.30.0080.00619.03
8.3.20.0040.00420.21
8.3.10.0030.00522.05
8.3.00.0090.00020.46
8.2.170.0100.00722.96
8.2.160.0130.00619.13
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0120.00017.88
8.2.110.0060.00322.16
8.2.100.0070.00418.22
8.2.90.0050.00319.30
8.2.80.0040.00418.05
8.2.70.0090.00018.00
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0060.00318.41
8.2.30.0000.00818.21
8.2.20.0040.00417.87
8.2.10.0040.00417.95
8.2.00.0060.00318.01
8.1.270.0080.00022.06
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00318.82
8.1.230.0090.00319.15
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0000.00817.53
8.1.180.0030.00618.77
8.1.170.0040.00718.49
8.1.160.0040.00422.24
8.1.150.0080.00018.72
8.1.140.0030.00617.62
8.1.130.0030.00317.95
8.1.120.0030.00517.67
8.1.110.0070.00017.58
8.1.100.0080.00017.68
8.1.90.0040.00417.62
8.1.80.0000.00717.60
8.1.70.0070.00017.66
8.1.60.0040.00417.68
8.1.50.0040.00417.68
8.1.40.0040.00417.54
8.1.30.0070.00017.69
8.1.20.0030.00617.81
8.1.10.0000.00917.75
8.1.00.0030.00517.64
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0040.00418.60
8.0.270.0070.00017.29
8.0.260.0070.00017.04
8.0.250.0070.00017.11
8.0.240.0030.00817.13
8.0.230.0040.00417.22
8.0.220.0030.00317.20
8.0.210.0070.00017.15
8.0.200.0060.00017.11
8.0.190.0060.00317.07
8.0.180.0000.00817.16
8.0.170.0040.00417.15
8.0.160.0000.00817.15
8.0.150.0070.00017.12
8.0.140.0070.00417.02
8.0.130.0000.00713.49
8.0.120.0040.00417.15
8.0.110.0000.00817.09
8.0.100.0040.00417.02
8.0.90.0000.00817.00
8.0.80.0100.00717.16
8.0.70.0050.00217.11
8.0.60.0070.00017.05
8.0.50.0060.00316.97
8.0.30.0120.00617.35
8.0.20.0110.01117.40
8.0.10.0040.00417.35
8.0.00.0090.00916.97
7.4.330.0000.00615.00
7.4.320.0030.00316.68
7.4.300.0000.00616.75
7.4.290.0030.00316.80
7.4.280.0000.00716.76
7.4.270.0030.00516.74
7.4.260.0000.00716.77
7.4.250.0080.00016.63
7.4.240.0020.00516.66
7.4.230.0070.00016.78
7.4.220.0130.00616.76
7.4.210.0070.00916.71
7.4.200.0060.00316.40
7.4.190.0080.00016.69
7.4.160.0060.00916.76
7.4.150.0110.00717.40
7.4.140.0120.00617.86
7.4.130.0080.00916.75
7.4.120.0090.00816.75
7.4.110.0060.01216.79
7.4.100.0160.00316.55
7.4.90.0070.01516.43
7.4.80.0100.01019.39
7.4.70.0160.00416.60
7.4.60.0060.01116.82
7.4.50.0040.00416.49
7.4.40.0110.00722.77
7.4.30.0080.00816.55
7.4.00.0050.01115.29
7.3.330.0030.00313.37
7.3.320.0000.00713.32
7.3.310.0070.00016.38
7.3.300.0030.00316.41
7.3.290.0070.01116.50
7.3.280.0120.00616.50
7.3.270.0070.01017.40
7.3.260.0090.00816.72
7.3.250.0120.00716.62
7.3.240.0120.00616.69
7.3.230.0140.00716.78
7.3.210.0070.01116.69
7.3.200.0030.01316.62
7.3.190.0070.01016.86
7.3.180.0000.01716.57
7.3.170.0130.00316.49
7.3.160.0060.01616.75
7.3.120.0050.01214.99
7.3.110.0090.00715.09
7.3.100.0050.00915.13
7.3.90.0060.00914.98
7.3.80.0040.00915.00
7.3.70.0060.00714.98
7.3.60.0000.01215.09
7.3.50.0060.00714.85
7.3.40.0050.00715.06
7.3.30.0090.00515.07
7.3.20.0000.01116.83
7.3.10.0100.00516.95
7.3.00.0010.00916.81
7.2.330.0070.01016.96
7.2.320.0120.00916.81
7.2.310.0030.01316.81
7.2.300.0110.00516.88
7.2.290.0070.01016.50
7.2.250.0100.01015.51
7.2.240.0060.01115.05
7.2.230.0030.01115.14
7.2.220.0070.00915.36
7.2.210.0020.01015.37
7.2.200.0030.01115.23
7.2.190.0080.00615.25
7.2.180.0070.00815.29
7.2.170.0070.00715.13
7.2.160.0060.00815.31
7.2.150.0070.00716.88
7.2.140.0060.00617.03
7.2.130.0090.00316.90
7.2.120.0040.00717.11
7.2.110.0030.00616.66
7.2.100.0030.01217.11
7.2.90.0030.01016.83
7.2.80.0070.00717.15
7.2.70.0060.00616.82
7.2.60.0030.01317.15
7.2.50.0070.00317.06
7.2.40.0070.01017.19
7.2.30.0080.00817.10
7.2.20.0030.00917.06
7.2.10.0040.00717.21
7.2.00.0060.00518.34
7.1.330.0000.01416.02
7.1.320.0030.01216.00
7.1.310.0100.00515.94
7.1.300.0030.00915.96
7.1.290.0100.00515.95
7.1.280.0080.00515.86
7.1.270.0050.00515.97
7.1.260.0030.01015.98
7.1.250.0040.00716.14
7.1.100.0030.00718.39
7.1.70.0150.00617.36
7.1.60.0000.01719.82
7.1.50.0030.00916.88
7.1.00.0070.07322.44
7.0.200.0000.01017.14
7.0.140.0000.07721.93
7.0.90.0200.05019.84
7.0.80.0030.04720.00
7.0.70.0000.04319.86
7.0.60.0230.03319.95
7.0.50.0030.05020.43
7.0.40.0070.05720.07
7.0.30.0170.06720.15
7.0.20.0030.04320.18
7.0.10.0130.06020.04
7.0.00.0070.04020.10
5.6.280.0070.07020.99
5.6.240.0030.04320.65
5.6.230.0030.04320.64
5.6.220.0000.05320.64
5.6.210.0070.04320.41
5.6.200.0030.04321.00
5.6.190.0100.03720.97
5.6.180.0070.05021.07
5.6.170.0070.04021.12
5.6.160.0100.03721.18
5.6.150.0030.04021.00
5.6.140.0130.03321.09
5.6.130.0030.04320.94
5.6.120.0000.04721.06
5.6.110.0030.06021.04
5.6.100.0070.03321.13
5.6.90.0030.04321.02
5.6.80.0070.07020.34
5.6.70.0070.03720.56
5.6.60.0070.03720.51
5.6.50.0100.03020.41
5.6.40.0100.08020.50
5.6.30.0130.07020.45
5.6.20.0030.05320.46
5.6.10.0070.06720.53
5.6.00.0130.06720.38
5.5.380.0030.04320.39
5.5.370.0070.04020.52
5.5.360.0000.03720.30
5.5.350.0070.03720.30
5.5.340.0000.04720.81
5.5.330.0030.04020.75
5.5.320.0070.03720.82
5.5.310.0100.03720.80
5.5.300.0070.04020.93
5.5.290.0070.04020.65
5.5.280.0000.04720.92
5.5.270.0100.03720.91
5.5.260.0000.04720.88
5.5.250.0030.04020.71
5.5.240.0100.03320.23
5.5.230.0070.04320.17
5.5.220.0130.07320.22
5.5.210.0000.04320.28
5.5.200.0000.05720.27
5.5.190.0100.07320.29
5.5.180.0070.07020.26
5.5.160.0170.03720.14
5.5.150.0070.04720.00
5.5.140.0100.07720.12
5.5.130.0070.05720.16
5.5.120.0100.04020.16
5.5.110.0030.07720.19
5.5.100.0170.04320.13
5.5.90.0070.07720.17
5.5.80.0070.08320.17
5.5.70.0100.05320.06
5.5.60.0130.07720.00
5.5.50.0030.05320.12
5.5.40.0100.07719.94
5.5.30.0030.05020.01
5.5.20.0030.05320.04
5.5.10.0030.08720.05
5.5.00.0100.07320.05
5.4.450.0030.04019.38
5.4.440.0000.04319.19
5.4.430.0070.03019.36
5.4.420.0100.03319.47
5.4.410.0030.04019.31
5.4.400.0000.04318.99
5.4.390.0070.03719.21
5.4.380.0030.03718.87
5.4.370.0130.03019.13
5.4.360.0030.06018.93
5.4.350.0070.08319.11
5.4.340.0100.06018.93
5.4.320.0030.07319.21
5.4.310.0070.07319.03
5.4.300.0070.08019.16
5.4.290.0070.04019.20
5.4.280.0070.08019.20
5.4.270.0030.08319.16
5.4.260.0100.07318.88
5.4.250.0000.07319.09
5.4.240.0070.08718.92
5.4.230.0130.03018.82
5.4.220.0070.06319.15
5.4.210.0000.06319.03
5.4.200.0030.05019.04
5.4.190.0130.07319.17
5.4.180.0100.05019.20
5.4.170.0170.04319.17
5.4.160.0200.06719.08
5.4.150.0070.07319.14
5.4.140.0100.07016.42
5.4.130.0100.07316.43
5.4.120.0030.07316.40
5.4.110.0170.06716.45
5.4.100.0000.05016.50
5.4.90.0030.08016.41
5.4.80.0070.04716.43
5.4.70.0000.07316.42
5.4.60.0000.07716.44
5.4.50.0130.06016.53
5.4.40.0070.07016.54
5.4.30.0030.07716.42
5.4.20.0100.07016.41
5.4.10.0030.07716.53
5.4.00.0100.06715.71
5.3.290.0100.05714.78
5.3.280.0070.03714.70
5.3.270.0030.07314.72
5.3.260.0030.07714.58
5.3.250.0000.05314.66
5.3.240.0030.06714.54
5.3.230.0070.08014.59
5.3.220.0200.03714.61
5.3.210.0130.06714.54
5.3.200.0030.05314.61
5.3.190.0170.03314.64
5.3.180.0030.05014.63
5.3.170.0100.06714.52
5.3.160.0030.04714.58
5.3.150.0000.04714.70
5.3.140.0100.07014.64
5.3.130.0100.08014.67
5.3.120.0130.06014.57
5.3.110.0030.07014.48
5.3.100.0100.03714.11
5.3.90.0070.06314.13
5.3.80.0030.06014.14
5.3.70.0100.04714.12
5.3.60.0070.06714.15
5.3.50.0100.07013.85
5.3.40.0170.07014.02
5.3.30.0000.08014.03
5.3.20.0100.05313.59
5.3.10.0000.04313.70
5.3.00.0200.06013.55
5.2.170.0030.06311.04
5.2.160.0100.05011.07
5.2.150.0000.04711.27
5.2.140.0070.04011.20
5.2.130.0000.03311.01
5.2.120.0030.03311.16
5.2.110.0070.05711.00
5.2.100.0030.05011.13
5.2.90.0070.05711.12
5.2.80.0000.04311.21
5.2.70.0100.04711.04
5.2.60.0000.05711.07
5.2.50.0100.05711.08
5.2.40.0070.06011.05
5.2.30.0100.06010.87
5.2.20.0070.05011.09
5.2.10.0130.03010.94
5.2.00.0030.06010.75
5.1.60.0070.05010.29
5.1.50.0070.05710.29
5.1.40.0030.04710.29
5.1.30.0070.05010.38
5.1.20.0100.04710.30
5.1.10.0000.03710.29
5.1.00.0100.02710.29
5.0.50.0130.03010.29
5.0.40.0030.05010.29
5.0.30.0030.05010.29
5.0.20.0170.03010.29
5.0.10.0030.04310.29
5.0.00.0030.03710.29
4.4.90.0000.03310.29
4.4.80.0030.01710.29
4.4.70.0000.02010.29
4.4.60.0070.01310.29
4.4.50.0070.02010.29
4.4.40.0030.05010.29
4.4.30.0000.03310.29
4.4.20.0000.03710.29
4.4.10.0030.01310.29
4.4.00.0030.03310.29
4.3.110.0030.03710.29
4.3.100.0070.03010.29
4.3.90.0030.03310.29
4.3.80.0000.05310.29
4.3.70.0000.03710.29
4.3.60.0030.03310.29
4.3.50.0000.03710.29
4.3.40.0030.05010.29
4.3.30.0000.01710.29
4.3.20.0030.01710.29
4.3.10.0000.03010.29
4.3.00.0030.02010.29

preferences:
38.79 ms | 400 KiB | 5 Q