3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $fechaMIN = "2010-01-01"; $fechaMAX = "2011-05-31"; $ts1 = strtotime( $fechaMIN ); $ts2 = strtotime( $fechaMAX ); $year1 = date( 'Y', $ts1 ); $year2 = date( 'Y', $ts2 ); $month1 = date( 'm', $ts1 ); $month2 = date( 'm', $ts2 ); $day1 = date( 'd', $ts1 ); $day2 = date( 'd', $ts2 ); $month1_days = date( 't', $ts1 ); $month2_days = date( 't', $ts2 ); $d1 = new DateTime( date( 'Y-m-d', $ts1 ) ); $d2 = new DateTime( date( 'Y-m-d', strtotime( $fechaMAX .' +1 day') ) ); $diff = $d2->diff( $d1, true ); $month2_days = (int) date( 't ', $d2->getTimestamp() ); echo "$fechaMIN >> $fechaMAX >>>> " . date( 'Y-m-d ', $d1->getTimestamp() ) . ' >> ' . date( 'Y-m-d ', $d2->getTimestamp() ) ; $diff_months = round( $diff->y * 12 + $diff->m + ( ( $diff->d ) / $month2_days ), 6 ); echo " >>> ". $diff_months .PHP_EOL;

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.70.0080.00816.50
8.3.60.0070.01018.30
8.3.50.0200.00521.09
8.3.40.0000.01518.96
8.3.30.0110.00318.93
8.3.20.0050.00318.91
8.3.10.0040.00421.90
8.3.00.0050.00320.77
8.2.190.0100.01016.58
8.2.180.0180.00316.88
8.2.170.0140.00722.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0060.00326.16
8.2.120.0040.00420.01
8.2.110.0000.01022.04
8.2.100.0030.00919.14
8.2.90.0000.00817.75
8.2.80.0000.00917.97
8.2.70.0030.00618.15
8.2.60.0000.00818.16
8.2.50.0000.00818.10
8.2.40.0080.00020.73
8.2.30.0000.00719.46
8.2.20.0070.00018.21
8.2.10.0040.00418.34
8.2.00.0040.00418.02
8.1.280.0170.00025.92
8.1.270.0030.00622.25
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0170.00320.83
8.1.230.0080.00419.20
8.1.220.0040.00417.91
8.1.210.0080.00018.77
8.1.200.0050.00517.60
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0050.00318.71
8.1.160.0070.00019.08
8.1.150.0000.00720.27
8.1.140.0040.00419.59
8.1.130.0000.00717.76
8.1.120.0050.00317.80
8.1.110.0100.00017.61
8.1.100.0080.00017.75
8.1.90.0040.00417.69
8.1.80.0050.00317.62
8.1.70.0000.00717.74
8.1.60.0040.00417.70
8.1.50.0050.00317.66
8.1.40.0050.00517.70
8.1.30.0000.00917.71
8.1.20.0040.00417.83
8.1.10.0050.00317.68
8.1.00.0000.00817.78
8.0.300.0070.00019.66
8.0.290.0030.00616.75
8.0.280.0040.00418.57
8.0.270.0030.00617.45
8.0.260.0060.00017.29
8.0.250.0000.01017.21
8.0.240.0040.00417.29
8.0.230.0000.00717.27
8.0.220.0000.00717.16
8.0.210.0030.00317.13
8.0.200.0030.00317.15
8.0.190.0000.00717.25
8.0.180.0040.00417.19
8.0.170.0050.00317.09
8.0.160.0000.00717.14
8.0.150.0070.00017.11
8.0.140.0040.00417.06
8.0.130.0030.00313.50
8.0.120.0000.00817.11
8.0.110.0040.00417.19
8.0.100.0070.00017.03
8.0.90.0040.00417.17
8.0.80.0100.00717.18
8.0.70.0000.00817.12
8.0.60.0080.00017.07
8.0.50.0000.00717.20
8.0.30.0090.01017.45
8.0.20.0110.00917.42
8.0.10.0000.00817.41
8.0.00.0080.00817.02
7.4.330.0060.00015.55
7.4.320.0030.00316.82
7.4.300.0030.00316.62
7.4.290.0030.00316.85
7.4.280.0060.00316.80
7.4.270.0000.00816.62
7.4.260.0050.00216.70
7.4.250.0030.00316.77
7.4.240.0030.00316.85
7.4.230.0030.00316.92
7.4.220.0060.01316.60
7.4.210.0090.00716.84
7.4.200.0040.00416.85
7.4.160.0110.00516.78
7.4.150.0000.01717.40
7.4.140.0120.00617.86
7.4.130.0120.00616.77
7.4.120.0110.00716.80
7.4.110.0160.00016.65
7.4.100.0100.00716.69
7.4.90.0140.00316.88
7.4.80.0070.01019.39
7.4.70.0100.01016.80
7.4.60.0100.00716.72
7.4.50.0030.01216.59
7.4.40.0030.01316.79
7.4.30.0070.01716.83
7.4.00.0110.00415.18
7.3.330.0000.00713.29
7.3.320.0030.00313.28
7.3.310.0070.00016.39
7.3.300.0060.00016.55
7.3.290.0080.00816.55
7.3.280.0120.00816.54
7.3.270.0120.01217.40
7.3.260.0090.00816.75
7.3.250.0120.00716.74
7.3.240.0060.01116.56
7.3.230.0070.01016.76
7.3.210.0070.01116.57
7.3.200.0070.01016.76
7.3.190.0160.00616.68
7.3.180.0140.00316.51
7.3.170.0120.00616.79
7.3.160.0120.00916.69
7.3.10.0040.01316.59
7.3.00.0070.01116.84
7.2.330.0000.01716.73
7.2.320.0150.00317.04
7.2.310.0060.00917.04
7.2.300.0140.00416.85
7.2.290.0040.01417.13
7.2.130.0070.00716.94
7.2.120.0060.01216.72
7.2.110.0120.01016.84
7.2.100.0160.00816.80
7.2.90.0100.01317.03
7.2.80.0130.00716.64
7.2.70.0210.00316.87
7.2.60.0070.01017.05
7.2.50.0160.01216.97
7.2.40.0170.01117.17
7.2.30.0140.00516.81
7.2.20.0070.01417.02
7.2.10.0110.01116.72
7.2.00.0120.00317.30
7.1.250.0210.00315.62
7.1.70.0060.01017.57
7.1.60.0070.00317.61
7.1.00.0170.08022.38
7.0.200.0280.01014.93
7.0.130.0130.07022.07
7.0.120.0130.07021.96
7.0.110.0130.07722.08
7.0.100.0100.05321.96
7.0.90.0200.06322.04
7.0.80.0030.06721.98
7.0.70.0070.05722.12
7.0.60.0100.06021.90
7.0.50.0030.08022.00
7.0.40.0070.07322.15
7.0.30.0000.07322.02
7.0.20.0130.07022.14
7.0.10.0070.07322.15
7.0.00.0070.07721.98
5.6.280.0230.05720.80
5.6.270.0130.07021.14
5.6.260.0000.08020.94
5.6.250.0130.06720.93
5.6.240.0130.06720.75
5.6.230.0070.06720.95
5.6.220.0170.05021.06
5.6.210.0100.05720.95
5.6.200.0070.07320.79
5.6.190.0170.06321.05
5.6.180.0100.07021.05
5.6.170.0100.06721.05
5.6.160.0070.06720.93
5.6.150.0030.06021.09
5.6.140.0100.07020.92
5.6.130.0070.05320.78
5.6.120.0030.06021.04
5.6.110.0100.05321.05
5.6.100.0030.06721.02
5.6.90.0130.06720.88
5.6.80.0070.05720.39
5.6.70.0170.05020.39
5.6.60.0070.07020.23
5.6.50.0070.07020.47
5.6.40.0000.08020.18
5.6.30.0070.06020.39
5.6.20.0000.09320.18
5.6.10.0130.07720.11
5.6.00.0070.08020.12

preferences:
82.97 ms | 401 KiB | 5 Q