3v4l.org

run code in 300+ PHP versions simultaneously
<?php $day1 = new DateTime( '2013-01-01' ); $day1->modify( '+1 month' ); $day1nextmonth=$day1->format( 'm' ); $day1result=$day1->format( 'd-m-Y' ); $day2 = new DateTime( '2013-01-01' ); $day2->modify( 'last day of next month' ); $day2nextmonth=$day2->format( 'm' ); $day2result=$day2->format( 'd-m-Y' ); echo "1st-".$day1result, "\n"; echo "2nd-".$day2result, "\n"; echo "1stnext month-".$day1nextmonth, "\n"; echo "2ndnext month-".$day2nextmonth, "\n"; $result=($day1nextmonth == $day2nextmonth)?$day1result:$day2result; echo $result;

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.0070.01418.56
8.3.50.0080.00822.08
8.3.40.0130.00718.82
8.3.30.0120.00318.76
8.3.20.0080.00018.89
8.3.10.0030.00521.21
8.3.00.0050.00222.07
8.2.180.0070.01316.75
8.2.170.0070.00722.96
8.2.160.0110.00320.35
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00319.60
8.2.110.0070.00320.38
8.2.100.0040.00718.03
8.2.90.0080.00019.39
8.2.80.0050.00318.05
8.2.70.0050.00317.75
8.2.60.0000.00918.18
8.2.50.0080.00018.07
8.2.40.0040.00418.22
8.2.30.0040.00419.91
8.2.20.0000.00817.79
8.2.10.0030.00618.00
8.2.00.0000.00817.99
8.1.280.0070.01025.92
8.1.270.0050.00223.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0110.00022.71
8.1.230.0060.00620.95
8.1.220.0060.00318.77
8.1.210.0040.00418.87
8.1.200.0060.00317.60
8.1.190.0040.00419.31
8.1.180.0060.00318.10
8.1.170.0040.00418.83
8.1.160.0040.00419.03
8.1.150.0070.00018.80
8.1.140.0030.00517.66
8.1.130.0000.00718.00
8.1.120.0000.00817.74
8.1.110.0040.00417.66
8.1.100.0080.00017.77
8.1.90.0040.00417.75
8.1.80.0000.00717.61
8.1.70.0030.00317.63
8.1.60.0030.00617.71
8.1.50.0000.00717.64
8.1.40.0060.00317.71
8.1.30.0040.00417.86
8.1.20.0040.00417.89
8.1.10.0040.00417.68
8.1.00.0030.00617.74
8.0.300.0000.00720.07
8.0.290.0000.00717.29
8.0.280.0030.00418.64
8.0.270.0000.00717.32
8.0.260.0070.00016.99
8.0.250.0000.00817.23
8.0.240.0030.00617.21
8.0.230.0060.00317.22
8.0.220.0000.00717.17
8.0.210.0000.00717.13
8.0.200.0030.00317.08
8.0.190.0000.00717.25
8.0.180.0040.00417.08
8.0.170.0040.00417.25
8.0.160.0000.00717.26
8.0.150.0040.00417.14
8.0.140.0030.00717.18
8.0.130.0040.00413.51
8.0.120.0030.00617.13
8.0.110.0040.00417.00
8.0.100.0000.00817.18
8.0.90.0000.00717.15
8.0.80.0130.00917.13
8.0.70.0080.00017.16
8.0.60.0000.00817.07
8.0.50.0020.00517.09
8.0.30.0120.00617.41
8.0.20.0080.01017.50
8.0.10.0070.00017.34
8.0.00.0140.00417.07
7.4.330.0030.00314.91
7.4.320.0040.00416.76
7.4.300.0070.00016.68
7.4.290.0030.00316.68
7.4.280.0040.00416.63
7.4.270.0080.00016.73
7.4.260.0000.00613.37
7.4.250.0040.00416.61
7.4.240.0040.00416.66
7.4.230.0030.00316.63
7.4.220.0030.01316.76
7.4.210.0060.00816.71
7.4.200.0030.00316.56
7.4.190.0000.00716.61
7.4.160.0070.01016.89
7.4.150.0130.00717.40
7.4.140.0090.00917.86
7.4.130.0130.00816.71
7.4.120.0100.00816.73
7.4.110.0110.00516.77
7.4.100.0100.00716.75
7.4.90.0060.01216.80
7.4.80.0100.00719.37
7.4.70.0090.00616.64
7.4.60.0080.00716.74
7.4.50.0040.00416.44
7.4.40.0060.00922.27
7.4.30.0090.01216.63
7.4.00.0030.01415.32
7.3.330.0000.00613.18
7.3.320.0000.00513.11
7.3.310.0030.00316.34
7.3.300.0070.00016.40
7.3.290.0110.00716.43
7.3.280.0050.01016.41
7.3.270.0150.00317.40
7.3.260.0110.00718.24
7.3.250.0160.01116.81
7.3.240.0120.00616.74
7.3.230.0040.01216.61
7.3.210.0120.00816.65
7.3.200.0090.00919.39
7.3.190.0120.00816.73
7.3.180.0130.00316.73
7.3.170.0080.00816.65
7.3.160.0100.00616.42
7.3.120.0070.01014.78
7.2.330.0110.00816.96
7.2.320.0030.01316.84
7.2.310.0090.00916.95
7.2.300.0080.01016.67
7.2.290.0100.00616.78
7.2.00.0060.00619.57
7.1.200.0000.00715.89
7.1.100.0050.00318.39
7.1.70.0040.00417.43
7.1.60.0050.00519.40
7.1.50.0090.01217.17
7.1.00.0070.07322.33
7.0.200.0050.00317.00
7.0.140.0100.06722.10
7.0.60.0000.05721.72
7.0.50.0000.06022.05
7.0.40.0030.08320.19
7.0.30.0070.08019.99
7.0.20.0030.08720.15
7.0.10.0070.05320.10
7.0.00.0000.07320.18
5.6.280.0070.07021.06
5.6.210.0000.07720.59
5.6.200.0000.08721.12
5.6.190.0030.08020.90
5.6.180.0000.08021.04
5.6.170.0070.08021.12
5.6.160.0030.08320.99
5.6.150.0030.06021.11
5.6.140.0100.07721.04
5.6.130.0030.08020.98
5.6.120.0000.09021.07
5.6.110.0170.07720.95
5.6.100.0030.08720.95
5.6.90.0030.06321.02
5.6.80.0000.08020.36
5.6.70.0130.06320.52
5.6.60.0030.07320.36
5.6.50.0070.06720.43
5.6.40.0100.07320.35
5.6.30.0100.07320.39
5.6.20.0000.06320.49
5.6.10.0100.03720.35
5.6.00.0000.06320.48
5.5.350.0000.05720.49
5.5.340.0130.07020.88
5.5.330.0100.07020.89
5.5.320.0030.08020.77
5.5.310.0100.07720.77
5.5.300.0100.07720.89
5.5.290.0000.07320.95
5.5.280.0030.08720.86
5.5.270.0100.07320.79
5.5.260.0000.07320.86
5.5.250.0070.07720.75
5.5.240.0000.04720.19
5.5.230.0070.07720.18
5.5.220.0070.06320.19
5.5.210.0100.06320.18
5.5.200.0000.08020.00
5.5.190.0070.08020.25
5.5.180.0070.06720.25
5.5.160.0070.06720.23
5.5.150.0000.07720.21
5.5.140.0200.06320.00
5.5.130.0070.07020.11
5.5.120.0000.04020.11
5.5.110.0100.04320.21
5.5.100.0070.06320.02
5.5.90.0100.05720.05
5.5.80.0030.07320.13
5.5.70.0070.06320.00
5.5.60.0000.07019.88
5.5.50.0070.07320.13
5.5.40.0100.06720.09
5.5.30.0000.07019.87
5.5.20.0000.06020.19
5.5.10.0030.06719.89
5.5.00.0070.07320.04
5.4.450.0030.08019.48
5.4.440.0000.08319.48
5.4.430.0070.07719.25
5.4.420.0000.06319.46
5.4.410.0100.07319.30
5.4.400.0000.08318.93
5.4.390.0070.06718.98
5.4.380.0000.06319.01
5.4.370.0070.06019.00
5.4.360.0000.08018.90
5.4.350.0000.05319.06
5.4.340.0100.06019.00
5.4.320.0030.07319.10
5.4.310.0070.07719.00
5.4.300.0030.05318.89
5.4.290.0000.08019.16
5.4.280.0070.04319.00
5.4.270.0100.03019.05
5.4.260.0030.05719.00
5.4.250.0070.06019.06
5.4.240.0100.05719.01
5.4.230.0030.07318.91
5.4.220.0030.07019.00
5.4.210.0100.06718.98
5.4.200.0000.08018.94
5.4.190.0000.05718.84
5.4.180.0100.07318.83
5.4.170.0170.07019.19
5.4.160.0030.08018.98
5.4.150.0070.07018.96
5.4.140.0030.06016.41
5.4.130.0000.06716.37
5.4.120.0000.07316.41
5.4.110.0030.04316.47
5.4.100.0070.03716.47
5.4.90.0030.03716.38
5.4.80.0030.05316.34
5.4.70.0070.05316.44
5.4.60.0030.04016.38
5.4.50.0000.06316.39
5.4.40.0000.05316.33
5.4.30.0030.06316.22
5.4.20.0030.06316.21
5.4.10.0030.06716.23
5.4.00.0000.07315.73
5.3.290.0130.06014.64
5.3.280.0030.08314.57
5.3.270.0070.07714.53
5.3.260.0100.07014.56
5.3.250.0070.05314.39
5.3.240.0070.05714.50
5.3.230.0100.07314.53
5.3.220.0100.07314.49
5.3.210.0070.07014.41
5.3.200.0030.07314.48
5.3.190.0000.04014.50
5.3.180.0030.06014.39
5.3.170.0030.04714.51
5.3.160.0030.06714.46
5.3.150.0030.06314.54
5.3.140.0000.04314.52
5.3.130.0100.07314.51
5.3.120.0070.06714.52
5.3.110.0070.07714.46
5.3.100.0070.06713.86
5.3.90.0000.07013.91
5.3.80.0000.07713.98
5.3.70.0000.07313.96
5.3.60.0070.07013.96
5.3.50.0070.07013.91
5.3.40.0030.06313.71
5.3.30.0000.07713.88
5.3.20.0000.04313.64
5.3.10.0030.07313.50
5.3.00.0100.06313.61
5.2.170.0070.05711.13
5.2.160.0000.06311.13
5.2.150.0070.04010.95
5.2.140.0030.06010.97
5.2.130.0000.05011.10
5.2.120.0030.04711.01
5.2.110.0000.06310.93
5.2.100.0000.06310.93
5.2.90.0030.04711.13
5.2.80.0030.05010.89
5.2.70.0070.05710.88
5.2.60.0000.05011.07
5.2.50.0000.03310.93
5.2.40.0030.03711.04
5.2.30.0000.06010.76
5.2.20.0030.06010.87
5.2.10.0000.05010.86
5.2.00.0000.03710.76
5.1.60.0030.04010.02
5.1.50.0070.05010.00
5.1.40.0030.0479.95
5.1.30.0030.05010.34
5.1.20.0030.05710.35
5.1.10.0030.0539.90
5.1.00.0000.06010.09
5.0.50.0000.0478.99
5.0.40.0030.0438.99
5.0.30.0000.0678.99
5.0.20.0000.0478.99
5.0.10.0030.0438.99
5.0.00.0000.0678.99
4.4.90.0030.0338.99
4.4.80.0030.0338.99
4.4.70.0030.0338.99
4.4.60.0000.0338.99
4.4.50.0000.0208.99
4.4.40.0030.0578.99
4.4.30.0070.0308.99
4.4.20.0000.0338.99
4.4.10.0030.0378.99
4.4.00.0070.0438.99
4.3.110.0000.0278.99
4.3.100.0000.0308.99
4.3.90.0030.0338.99
4.3.80.0000.0478.99
4.3.70.0000.0338.99
4.3.60.0000.0278.99
4.3.50.0000.0378.99
4.3.40.0000.0578.99
4.3.30.0070.0308.99
4.3.20.0000.0278.99
4.3.10.0000.0378.99
4.3.00.0000.0378.99

preferences:
60.34 ms | 401 KiB | 5 Q