3v4l.org

run code in 300+ PHP versions simultaneously
<?php function monthsBetween($startDate, $endDate) { $retval = ""; // Assume YYYY-mm-dd - as is common MYSQL format $splitStart = explode('-', $startDate); $splitEnd = explode('-', $endDate); if (is_array($splitStart) && is_array($splitEnd)) { $difYears = $splitEnd[0] - $splitStart[0]; $difMonths = $splitEnd[1] - $splitStart[1]; $difDays = $splitEnd[2] - $splitStart[2]; $retval = ($difDays > 0) ? $difMonths : $difMonths - 1; $retval += $difYears * 12; } return $retval; } echo monthsBetween('2014-06-16','2015-05-16'); ?>

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.0140.00718.43
8.3.50.0130.00721.98
8.3.40.0040.01118.79
8.3.30.0110.00319.04
8.3.20.0040.00420.34
8.3.10.0050.00321.76
8.3.00.0040.00419.02
8.2.180.0060.00918.31
8.2.170.0090.00922.96
8.2.160.0050.00822.14
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00719.66
8.2.110.0030.00622.21
8.2.100.0060.00619.38
8.2.90.0040.00719.30
8.2.80.0000.00817.97
8.2.70.0050.00317.73
8.2.60.0000.00718.04
8.2.50.0060.00318.07
8.2.40.0070.00019.88
8.2.30.0050.00218.21
8.2.20.0080.00017.77
8.2.10.0090.00018.07
8.2.00.0040.00417.84
8.1.280.0140.00725.92
8.1.270.0040.00418.86
8.1.260.0100.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00423.96
8.1.230.0000.01218.97
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0030.01117.23
8.1.190.0000.00817.11
8.1.180.0040.00418.10
8.1.170.0060.00318.52
8.1.160.0040.00422.08
8.1.150.0020.00518.82
8.1.140.0040.00419.24
8.1.130.0040.00417.76
8.1.120.0030.00617.48
8.1.110.0050.00217.51
8.1.100.0040.00717.47
8.1.90.0000.00717.51
8.1.80.0000.00717.43
8.1.70.0040.00417.53
8.1.60.0080.00017.55
8.1.50.0050.00317.48
8.1.40.0040.00417.57
8.1.30.0030.00617.54
8.1.20.0000.00717.64
8.1.10.0070.00017.63
8.1.00.0050.00317.51
8.0.300.0050.00218.77
8.0.290.0030.00616.75
8.0.280.0040.00418.50
8.0.270.0030.00317.27
8.0.260.0000.00717.29
8.0.250.0000.00717.00
8.0.240.0030.00316.91
8.0.230.0000.00717.05
8.0.220.0040.00416.81
8.0.210.0000.00716.90
8.0.200.0050.00217.03
8.0.190.0000.00817.04
8.0.180.0080.00016.95
8.0.170.0070.00017.03
8.0.160.0000.00717.02
8.0.150.0050.00316.88
8.0.140.0070.00016.95
8.0.130.0000.00913.44
8.0.120.0050.00316.84
8.0.110.0000.00716.81
8.0.100.0030.00316.79
8.0.90.0000.00816.96
8.0.80.0030.01216.97
8.0.70.0030.00616.99
8.0.60.0040.00417.03
8.0.50.0000.00716.80
8.0.30.0150.00517.10
8.0.20.0120.00717.40
8.0.10.0060.00317.03
8.0.00.0140.00616.70
7.4.330.0000.00615.03
7.4.320.0000.00716.62
7.4.300.0040.00416.62
7.4.290.0000.00716.66
7.4.280.0070.00416.55
7.4.270.0000.00616.43
7.4.260.0000.00716.64
7.4.250.0000.00716.43
7.4.240.0030.00516.53
7.4.230.0070.00016.43
7.4.220.0070.01116.43
7.4.210.0100.00716.70
7.4.200.0040.00416.52
7.4.160.0090.00616.71
7.4.150.0150.00617.40
7.4.140.0100.01217.86
7.4.130.0100.01016.58
7.4.120.0100.00916.52
7.4.110.0030.01716.67
7.4.100.0060.01116.52
7.4.90.0100.00716.37
7.4.80.0070.01319.39
7.4.70.0060.01116.37
7.4.60.0070.01016.52
7.4.50.0000.00716.39
7.4.40.0140.01216.61
7.4.30.0060.01316.56
7.4.00.0050.01314.91
7.3.330.0030.00313.21
7.3.320.0000.00513.38
7.3.310.0070.00016.19
7.3.300.0000.00716.21
7.3.290.0060.01016.36
7.3.280.0060.00816.31
7.3.270.0070.01117.40
7.3.260.0130.00316.32
7.3.250.0090.01216.44
7.3.240.0060.01016.63
7.3.230.0070.01116.62
7.3.210.0140.00416.31
7.3.200.0060.01719.39
7.3.190.0070.01016.42
7.3.180.0030.01416.36
7.3.170.0070.01016.47
7.3.160.0090.00616.31
7.3.120.0080.00814.53
7.3.110.0080.00414.96
7.3.100.0070.01014.71
7.3.90.0090.00615.15
7.3.80.0070.01015.05
7.3.70.0030.01314.80
7.3.60.0000.01514.81
7.3.50.0100.00714.80
7.3.40.0060.00614.82
7.3.30.0000.01014.86
7.3.20.0110.00316.56
7.3.10.0040.00816.54
7.3.00.0060.00316.73
7.2.330.0110.00716.78
7.2.320.0040.01616.67
7.2.310.0120.01016.50
7.2.300.0120.00616.42
7.2.290.0060.01216.41
7.2.250.0070.01114.88
7.2.240.0090.00915.02
7.2.230.0040.01515.32
7.2.220.0100.00715.02
7.2.210.0100.00714.86
7.2.200.0000.01314.96
7.2.190.0110.00414.76
7.2.180.0060.00915.13
7.2.170.0060.00614.91
7.2.00.0040.00819.38
7.1.330.0060.00915.54
7.1.320.0070.00715.78
7.1.310.0030.00615.93
7.1.300.0000.00915.87
7.1.290.0040.01115.96
7.1.280.0060.00315.97
7.1.270.0040.01116.00
7.1.260.0000.01215.48
7.1.200.0030.01015.78
7.1.100.0070.00318.32
7.1.70.0090.00317.01
7.1.60.0100.01019.46
7.1.50.0040.01417.02
7.1.00.0030.07722.54
7.0.200.0060.00316.83
7.0.140.0000.03722.00
7.0.60.0030.05020.07
7.0.50.0030.06017.87
7.0.40.0130.04719.90
7.0.30.0230.07320.08
7.0.20.0330.07320.10
7.0.10.0100.08720.22
7.0.00.0030.05320.20
5.6.280.0100.06721.12
5.6.210.0130.07320.77
5.6.200.0100.03718.13
5.6.190.0130.07020.60
5.6.180.0300.03720.63
5.6.170.0070.05020.57
5.6.160.0100.06020.54
5.6.150.0100.04318.19
5.6.140.0070.05318.21
5.6.130.0070.07718.11
5.6.120.0170.06021.15
5.6.110.0200.06320.89
5.6.100.0100.08021.01
5.6.90.0170.07320.98
5.6.80.0070.04720.38
5.5.350.0130.03320.33
5.5.340.0030.04318.02
5.5.330.0170.06720.25
5.5.320.0270.08020.51
5.5.310.0200.04020.35
5.5.300.0100.07718.02
5.5.290.0070.05317.94
5.5.280.0030.05720.78
5.5.270.0170.07320.68
5.5.260.0100.08020.77
5.5.250.0070.04020.69
5.5.240.0100.07320.16
5.4.450.0730.06719.61
5.4.440.0130.06019.60
5.4.430.0100.05719.52
5.4.420.0100.05719.51
5.4.410.0070.05719.41
5.4.400.0170.06319.23
5.4.390.0270.04318.47
5.4.380.0170.06718.47
5.4.370.0130.05718.80
5.4.360.0130.05718.63
5.4.350.0300.04318.84
5.4.340.0230.07018.78
5.4.320.0300.06318.77
5.4.310.0300.04318.76
5.4.300.0230.07018.80
5.4.290.0230.04318.63
5.4.280.0130.05718.72
5.4.270.0170.05318.80
5.4.260.0200.05018.63
5.4.250.0200.05018.47
5.4.240.0170.05718.74
5.4.230.0200.05318.77
5.4.220.0130.06018.79
5.4.210.0170.05018.57
5.4.200.0270.04316.55
5.4.190.0230.04318.54
5.4.180.0300.04318.43
5.4.170.0230.04718.79
5.4.160.0170.05318.82
5.4.150.0130.05718.76
5.4.140.0170.05316.23
5.4.130.0070.06016.20
5.4.120.0000.06316.28
5.4.110.0170.05016.17
5.4.100.0170.05716.27
5.4.90.0100.06016.21
5.4.80.0230.05016.26
5.4.70.0200.05316.21
5.4.60.0130.05016.26
5.4.50.0230.04016.26
5.4.40.0170.05016.26
5.4.30.0100.05716.18
5.4.20.0200.05016.23
5.4.10.0130.05316.25
5.4.00.0230.04015.62
5.3.290.0170.06014.73
5.3.280.0230.04714.59
5.3.270.0230.05314.64
5.3.260.0170.05714.61
5.3.250.0300.05014.59
5.3.240.0270.04314.70
5.3.230.0130.05714.73
5.3.220.0270.04314.62
5.3.210.0100.06014.73
5.3.200.0130.05314.59
5.3.190.0200.05014.77
5.3.180.0200.05014.61
5.3.170.0200.04714.55
5.3.160.0200.04714.61
5.3.150.0100.05714.66
5.3.140.0270.04014.54
5.3.130.0170.05314.53
5.3.120.0000.07014.61
5.3.110.0130.06014.59
5.3.100.0330.04014.06
5.3.90.0230.04314.08
5.3.80.0130.05314.05
5.3.70.0130.05314.12
5.3.60.0200.04714.13
5.3.50.0300.04314.00
5.3.40.0200.05014.08
5.3.30.0070.06014.02
5.3.20.0170.05013.68
5.3.10.0170.04713.65
5.3.00.0100.05713.76
5.2.170.0070.05311.22
5.2.160.0100.04711.13
5.2.150.0130.04711.16
5.2.140.0170.04011.17
5.2.130.0100.04311.15
5.2.120.0130.04711.13
5.2.110.0100.04311.17
5.2.100.0230.03311.20
5.2.90.0200.03711.13
5.2.80.0130.04311.30
5.2.70.0130.04011.08
5.2.60.0130.04311.09
5.2.50.0130.04011.14
5.2.40.0070.04311.08
5.2.30.0070.04310.97
5.2.20.0100.04011.00
5.2.10.0100.04310.98
5.2.00.0130.03710.91
5.1.60.0130.04010.02
5.1.50.0130.03010.07
5.1.40.0130.03010.01
5.1.30.0070.04010.39
5.1.20.0100.03710.49
5.1.10.0070.03710.11
5.1.00.0070.04010.14
5.0.50.0000.0378.56
5.0.40.0100.0238.45
5.0.30.0030.0478.28
5.0.20.0070.0278.34
5.0.10.0070.0278.23
5.0.00.0030.0438.25
4.4.90.0070.0205.91
4.4.80.0030.0236.02
4.4.70.0100.0175.90
4.4.60.0070.0206.00
4.4.50.0030.0275.93
4.4.40.0070.0336.01
4.4.30.0030.0275.98
4.4.20.0030.0235.96
4.4.10.0100.0206.00
4.4.00.0070.0435.96
4.3.110.0030.0275.85
4.3.100.0070.0205.84
4.3.90.2730.0205.92
4.3.80.0100.0305.89
4.3.70.0070.0205.81
4.3.60.0100.0205.91
4.3.50.0030.0235.83
4.3.40.0000.0375.80
4.3.30.0000.0275.32
4.3.20.0030.0235.32
4.3.10.0030.0235.32
4.3.00.0130.0206.84

preferences:
49.9 ms | 401 KiB | 5 Q