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. if(strtotime($a)<strtotime($b)){ $temp = $a; $a = $b; $b = $a; unset($temp); } $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 $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.60.0130.01018.68
8.3.50.0070.00721.33
8.3.40.0180.00418.76
8.3.30.0100.01019.04
8.3.20.0080.00020.26
8.3.10.0080.00022.09
8.3.00.0050.00322.38
8.2.180.0140.00716.38
8.2.170.0040.01122.96
8.2.160.0090.01219.33
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0060.00626.16
8.2.120.0070.00417.88
8.2.110.0070.00322.20
8.2.100.0040.00819.88
8.2.90.0040.00419.17
8.2.80.0030.00518.05
8.2.70.0100.00017.88
8.2.60.0000.00817.92
8.2.50.0060.00318.07
8.2.40.0040.00718.34
8.2.30.0040.00418.21
8.2.20.0040.00418.00
8.2.10.0040.00417.97
8.2.00.0100.00018.08
8.1.280.0040.01125.92
8.1.270.0030.00618.82
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00023.82
8.1.230.0040.00719.00
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0060.00617.48
8.1.190.0000.00817.52
8.1.180.0000.00818.60
8.1.170.0040.00418.80
8.1.160.0070.00022.10
8.1.150.0070.00018.77
8.1.140.0040.00417.57
8.1.130.0000.00818.02
8.1.120.0070.00017.73
8.1.110.0000.00717.65
8.1.100.0030.00617.59
8.1.90.0000.00817.66
8.1.80.0040.00417.56
8.1.70.0030.00317.62
8.1.60.0080.00017.62
8.1.50.0030.00617.57
8.1.40.0080.00017.67
8.1.30.0050.00217.79
8.1.20.0040.00417.67
8.1.10.0040.00417.61
8.1.00.0040.00417.54
8.0.300.0030.00318.77
8.0.290.0030.00617.18
8.0.280.0030.00318.39
8.0.270.0040.00417.26
8.0.260.0070.00017.02
8.0.250.0030.00317.22
8.0.240.0090.00317.13
8.0.230.0030.00317.20
8.0.220.0000.00817.07
8.0.210.0030.00317.14
8.0.200.0050.00317.20
8.0.190.0000.00717.24
8.0.180.0080.00017.03
8.0.170.0040.00417.22
8.0.160.0000.00817.11
8.0.150.0080.00016.99
8.0.140.0030.00617.13
8.0.130.0050.00013.54
8.0.120.0050.00317.15
8.0.110.0040.00417.17
8.0.100.0030.00317.21
8.0.90.0080.00017.13
8.0.80.0100.01017.15
8.0.70.0000.00817.04
8.0.60.0050.00317.05
8.0.50.0070.00017.14
8.0.30.0150.00517.42
8.0.20.0120.00617.50
8.0.10.0000.00717.29
8.0.00.0080.01116.96
7.4.330.0000.00515.00
7.4.320.0000.00616.66
7.4.300.0030.00316.65
7.4.290.0040.00416.70
7.4.280.0050.00316.75
7.4.270.0030.00316.65
7.4.260.0000.00816.65
7.4.250.0050.00316.71
7.4.240.0040.00316.70
7.4.230.0070.00016.50
7.4.220.0110.00816.71
7.4.210.0030.01316.74
7.4.200.0080.00016.64
7.4.190.0050.00316.93
7.4.160.0110.00916.89
7.4.150.0060.01217.40
7.4.140.0160.00617.86
7.4.130.0080.01216.76
7.4.120.0130.00416.71
7.4.110.0060.01216.66
7.4.100.0070.01116.81
7.4.90.0060.01316.59
7.4.80.0100.01319.39
7.4.70.0030.02016.59
7.4.60.0110.01116.74
7.4.50.0090.00016.57
7.4.40.0040.01422.77
7.4.30.0160.00317.04
7.4.00.0070.01115.32
7.3.330.0000.00513.52
7.3.320.0030.00313.26
7.3.310.0000.00716.41
7.3.300.0000.00716.50
7.3.290.0110.00316.55
7.3.280.0070.00716.51
7.3.270.0170.00017.40
7.3.260.0110.00716.59
7.3.250.0100.00716.70
7.3.240.0170.00016.69
7.3.230.0120.00616.67
7.3.210.0090.00916.75
7.3.200.0070.01019.39
7.3.190.0120.00616.57
7.3.180.0080.00816.48
7.3.170.0120.00616.60
7.3.160.0100.00716.80
7.3.120.0060.01014.84
7.2.330.0110.01516.93
7.2.320.0060.01316.99
7.2.310.0030.01316.65
7.2.300.0100.00716.94
7.2.290.0100.00717.03
7.2.00.0070.00719.65
7.1.100.0000.00818.28
7.1.70.0070.00017.39
7.1.60.0000.02119.82
7.1.50.0090.00617.21
7.1.00.0030.04322.36
7.0.200.2780.00714.87
7.0.140.0070.07022.09
7.0.90.0200.07020.01
7.0.80.0030.09319.93
7.0.70.0030.09320.04
7.0.60.0030.09019.96
7.0.50.0100.08320.38
7.0.40.0070.08720.03
7.0.30.0130.08020.05
7.0.20.0130.07720.10
7.0.10.0100.07720.09
7.0.00.0100.07320.03
5.6.280.0030.07321.11
5.6.240.0170.08020.52
5.6.230.0030.06320.64
5.6.220.0030.06020.52
5.6.210.0070.09020.76
5.6.200.0200.04720.95
5.6.190.0170.07021.01
5.6.180.0100.08721.05
5.6.170.0100.08021.11
5.6.160.0100.03721.07
5.6.150.0030.04321.03
5.6.140.0070.07021.11
5.6.130.0100.08021.00
5.6.120.0130.08321.02
5.6.110.0100.08321.18
5.6.100.0000.04720.94
5.6.90.0070.05721.16
5.6.80.0070.08020.46
5.6.70.0070.07720.52
5.6.60.0030.05720.42
5.6.50.0100.04020.33
5.6.40.0170.04020.41
5.6.30.0070.08020.51
5.6.20.0100.07020.37
5.6.10.0100.05320.53
5.6.00.0070.08320.52
5.5.380.0100.07720.43
5.5.370.0200.04320.51
5.5.360.0200.06720.30
5.5.350.0170.06720.49
5.5.340.0130.06320.90
5.5.330.0130.07720.92
5.5.320.0170.07020.84
5.5.310.0130.07020.77
5.5.300.0100.07720.90
5.5.290.0130.07720.89
5.5.280.0100.08020.93
5.5.270.0100.08020.80
5.5.260.0130.07720.82
5.5.250.0100.08020.62
5.5.240.0070.06720.27
5.5.230.0170.07320.26
5.5.220.0130.07320.29
5.5.210.0070.05020.21
5.5.200.0130.07720.27
5.5.190.0100.05320.25
5.5.180.0070.07720.19
5.5.160.0030.07020.24
5.5.150.0030.04020.08
5.5.140.0200.06020.16
5.5.130.0030.05020.16
5.5.120.0130.07020.25
5.5.110.0100.05720.29
5.5.100.0170.07020.11
5.5.90.0030.04320.05
5.5.80.0070.05320.08
5.5.70.0100.08020.07
5.5.60.0100.03719.95
5.5.50.0100.07020.16
5.5.40.0070.07720.13
5.5.30.0130.06720.03
5.5.20.0130.07720.07
5.5.10.0100.07320.14
5.5.00.0170.06719.98
5.4.450.0130.04019.27
5.4.440.0100.07319.46
5.4.430.0070.07319.46
5.4.420.0030.04719.22
5.4.410.0200.06319.38
5.4.400.0100.08019.21
5.4.390.0070.07319.09
5.4.380.0130.05719.14
5.4.370.0130.06019.09
5.4.360.0170.06019.05
5.4.350.0100.06319.14
5.4.340.0100.05019.03
5.4.320.0070.06319.16
5.4.310.0030.05718.94
5.4.300.0100.07019.09
5.4.290.0170.06319.04
5.4.280.0070.03719.03
5.4.270.0000.05019.18
5.4.260.0130.07019.03
5.4.250.0070.07719.15
5.4.240.0130.06319.23
5.4.230.0070.07719.22
5.4.220.0100.06019.03
5.4.210.0170.03019.20
5.4.200.0130.06719.04
5.4.190.0030.06319.03
5.4.180.0000.05319.12
5.4.170.0170.06719.20
5.4.160.0100.06719.01
5.4.150.0100.07019.11
5.4.140.0070.07716.48
5.4.130.0070.07316.46
5.4.120.0070.07316.48
5.4.110.0130.07016.44
5.4.100.0200.06016.52
5.4.90.0170.06016.54
5.4.80.0100.06716.43
5.4.70.0070.07316.40
5.4.60.0070.07316.55
5.4.50.0100.06716.43
5.4.40.0130.06716.39
5.4.30.0100.06316.53
5.4.20.0030.04716.45
5.4.10.0030.07716.40
5.4.00.0100.06315.91
5.3.290.0070.04314.63
5.3.280.0100.04314.59
5.3.270.0030.08014.54
5.3.260.0100.07014.67
5.3.250.0030.04014.64
5.3.240.0030.07714.59
5.3.230.0100.07314.60
5.3.220.0130.06714.50
5.3.210.0100.07314.61
5.3.200.0100.06314.68
5.3.190.0070.07314.64
5.3.180.0000.08014.60
5.3.170.0100.07714.64
5.3.160.0100.07314.55
5.3.150.0030.07314.60
5.3.140.0100.06014.71
5.3.130.0070.05314.46
5.3.120.0030.04014.70
5.3.110.0170.02314.49
5.3.100.0100.07714.00
5.3.90.0070.06714.12
5.3.80.0130.07313.95
5.3.70.0130.07013.96
5.3.60.0130.07014.12
5.3.50.0100.07013.84
5.3.40.0030.08013.95
5.3.30.0070.06313.98
5.3.20.0000.07313.61
5.3.10.0000.05313.66
5.3.00.0030.04313.71
5.2.170.0030.06711.26
5.2.160.0130.05011.18
5.2.150.0030.05311.06
5.2.140.0030.06011.05
5.2.130.0070.03711.03
5.2.120.0030.06311.17
5.2.110.0000.05011.18
5.2.100.0000.03711.16
5.2.90.0030.06311.12
5.2.80.0130.05011.18
5.2.70.0070.06011.18
5.2.60.0030.04011.07
5.2.50.0070.06011.09
5.2.40.0000.06310.87
5.2.30.0070.06010.97
5.2.20.0030.03010.96
5.2.10.0030.04010.93
5.2.00.0030.06710.66
5.1.60.0070.05010.34
5.1.50.0070.04710.34
5.1.40.0030.03310.34
5.1.30.0070.05310.49
5.1.20.0070.05310.50
5.1.10.0070.03710.34
5.1.00.0100.03310.34
5.0.50.0030.03710.34
5.0.40.0030.04310.34
5.0.30.0030.06710.34
5.0.20.0070.03710.34
5.0.10.0030.02310.34
5.0.00.0000.06710.34
4.4.90.0030.03310.34
4.4.80.0030.03710.34
4.4.70.0030.03710.34
4.4.60.0000.03010.34
4.4.50.0000.03310.34
4.4.40.0070.05010.34
4.4.30.0070.03310.34
4.4.20.0000.03710.34
4.4.10.0000.04010.34
4.4.00.0000.02710.34
4.3.110.0000.03710.34
4.3.100.0000.03710.34
4.3.90.0030.02710.34
4.3.80.0000.05710.34
4.3.70.0070.03010.34
4.3.60.0070.02310.34
4.3.50.0030.03710.34
4.3.40.0100.04710.34
4.3.30.0000.03710.34
4.3.20.0070.03310.34
4.3.10.0000.02010.34
4.3.00.0000.03710.34

preferences:
44.88 ms | 401 KiB | 5 Q