3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sample1 = "2010-01-31"; $dnow = date("t",strtotime($sample1)); $dnext = date("t",strtotime($sample1 . " +1 month")); $dday = date("d",strtotime($sample1)); $output = strtotime("+1 month"); if ($dnext < $dnow && $dnext < $dday) { $nextMonth = date("Y-m", strtotime($sample)); $nextMonth = date("Y-m", strtotime($nextMonth . " +1 month")); $output = date("Y-m-d", strtotime($nextMonth . '-' . $dnext)); } echo $output; $ts = strtotime('2010-01-31 +1 month'); echo date('Y-m-d', $ts); echo "\n"; $dt = new \DateTime('2010-01-31'); $dt->add(new \DateInterval('P1M')); echo $dt->format('Y-m-d'); echo "\n"; $ts = strtotime('2010-01-05 +1 month'); echo date('Y-m-d', $ts); echo "\n"; $dt = new \DateTime('2010-01-05'); $dt->add(new \DateInterval('P1M')); echo $dt->format('Y-m-d');

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.0120.00316.75
8.3.50.0140.00222.06
8.3.40.0160.00318.81
8.3.30.0070.00719.17
8.3.20.0080.00020.33
8.3.10.0050.00223.48
8.3.00.0050.00320.54
8.2.180.0060.01316.88
8.2.170.0110.00722.96
8.2.160.0110.00322.12
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0030.00522.15
8.2.110.0090.00022.20
8.2.100.0090.00317.84
8.2.90.0030.00619.34
8.2.80.0040.00418.15
8.2.70.0030.00617.88
8.2.60.0000.00818.18
8.2.50.0030.00518.07
8.2.40.0100.00418.16
8.2.30.0040.00418.25
8.2.20.0080.00017.88
8.2.10.0000.00818.03
8.2.00.0060.00317.84
8.1.280.0120.00325.92
8.1.270.0080.00023.89
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.89
8.1.230.0040.00819.13
8.1.220.0000.00917.91
8.1.210.0060.00318.77
8.1.200.0070.00317.61
8.1.190.0030.00517.66
8.1.180.0040.00418.10
8.1.170.0100.00018.76
8.1.160.0000.01022.10
8.1.150.0050.00318.93
8.1.140.0040.00417.79
8.1.130.0040.00418.05
8.1.120.0080.00017.81
8.1.110.0030.00717.77
8.1.100.0030.00317.75
8.1.90.0000.00717.75
8.1.80.0000.00717.73
8.1.70.0040.00417.67
8.1.60.0090.00017.80
8.1.50.0030.00517.65
8.1.40.0080.00017.60
8.1.30.0080.00017.79
8.1.20.0030.00617.84
8.1.10.0000.00817.82
8.1.00.0080.00017.86
8.0.300.0000.00718.77
8.0.290.0040.00417.28
8.0.280.0040.00418.61
8.0.270.0070.00017.41
8.0.260.0000.00717.00
8.0.250.0050.00317.28
8.0.240.0070.00017.07
8.0.230.0070.00017.25
8.0.220.0000.00717.08
8.0.210.0020.00517.25
8.0.200.0040.00417.13
8.0.190.0050.00217.17
8.0.180.0000.00717.24
8.0.170.0000.00817.20
8.0.160.0040.00417.18
8.0.150.0080.00017.25
8.0.140.0050.00217.04
8.0.130.0060.00013.58
8.0.120.0000.00817.20
8.0.110.0040.00417.01
8.0.100.0050.00217.21
8.0.90.0040.00417.05
8.0.80.0090.01517.11
8.0.70.0000.00717.06
8.0.60.0070.00017.25
8.0.50.0000.00717.17
8.0.30.0110.01117.56
8.0.20.0110.00917.47
8.0.10.0030.00617.20
8.0.00.0060.01616.90
7.4.330.0000.00515.28
7.4.320.0000.00616.84
7.4.300.0030.00316.68
7.4.290.0110.00016.73
7.4.280.0030.00316.81
7.4.270.0030.00316.72
7.4.260.0050.00316.70
7.4.250.0050.00216.74
7.4.240.0040.00416.72
7.4.230.0070.00016.91
7.4.220.0120.00616.75
7.4.210.0070.00816.81
7.4.200.0000.00716.82
7.4.190.0030.00516.99
7.4.160.0170.00016.65
7.4.150.0090.00917.40
7.4.140.0080.01017.86
7.4.130.0080.01016.76
7.4.120.0100.00716.74
7.4.110.0140.00316.75
7.4.100.0100.01016.87
7.4.90.0140.00716.58
7.4.80.0100.01116.70
7.4.70.0070.01016.80
7.4.60.0100.00716.92
7.4.50.0000.00916.58
7.4.40.0080.00822.77
7.4.30.0090.00916.55
7.4.10.0150.00415.27
7.4.00.0020.01515.02
7.3.330.0050.00013.34
7.3.320.0030.00313.31
7.3.310.0050.00216.27
7.3.300.0040.00416.48
7.3.290.0030.01016.41
7.3.280.0120.00816.41
7.3.270.0070.01017.40
7.3.260.0050.01916.63
7.3.250.0070.01016.60
7.3.240.0100.00616.57
7.3.230.0090.00916.52
7.3.210.0130.00716.62
7.3.200.0170.00019.39
7.3.190.0110.01316.60
7.3.180.0060.01116.64
7.3.170.0120.00416.45
7.3.160.0120.00316.75
7.3.130.0100.00715.15
7.3.120.0080.01014.95
7.3.110.0130.00614.87
7.3.100.0100.00314.97
7.3.90.0090.00014.89
7.3.80.0040.00815.25
7.3.70.0080.00515.05
7.3.60.0070.00714.88
7.3.50.0050.00315.04
7.3.40.0100.00314.63
7.3.30.0100.00715.06
7.3.20.0070.00316.84
7.3.10.0070.00716.70
7.3.00.0070.00416.67
7.2.330.0120.00616.89
7.2.320.0070.01016.78
7.2.310.0100.01016.86
7.2.300.0070.01016.95
7.2.290.0130.00316.88
7.2.260.0060.01215.23
7.2.250.0040.01515.48
7.2.240.0060.00915.53
7.2.230.0030.01315.58
7.2.220.0120.00315.30
7.2.210.0120.00415.29
7.2.200.0070.01015.23
7.2.190.0060.00615.08
7.2.180.0000.00915.46
7.2.170.0000.01515.46
7.2.160.0060.00315.45
7.2.150.0070.00717.09
7.2.140.0060.00917.20
7.2.130.0030.01317.14
7.2.120.0060.00916.78
7.2.110.0070.00717.28
7.2.100.0030.00716.74
7.2.90.0070.01017.19
7.2.80.0060.00917.24
7.2.70.0070.00717.27
7.2.60.0050.00817.20
7.2.50.0030.00616.74
7.2.40.0030.01017.22
7.2.30.0080.00417.23
7.2.20.0060.00917.30
7.2.10.0040.00717.29
7.2.00.0040.01117.19
7.1.330.0070.00715.95
7.1.320.0040.01416.18
7.1.310.0000.00915.81
7.1.300.0080.00015.88
7.1.290.0040.01116.18
7.1.280.0100.00716.10
7.1.270.0000.01015.89
7.1.260.0070.00716.18
7.1.250.0070.00716.01
7.1.240.0070.00716.04
7.1.230.0000.01516.11
7.1.220.0130.00015.83
7.1.210.0100.00616.13
7.1.200.0070.00815.85
7.1.190.0040.01115.98
7.1.180.0150.00016.04
7.1.170.0050.00516.25
7.1.160.0060.00316.13
7.1.150.0000.00815.98
7.1.140.0030.01016.16
7.1.130.0000.01215.75
7.1.120.0070.00715.74
7.1.110.0130.00316.20
7.1.100.0060.00417.17
7.1.90.0030.00616.07
7.1.80.0060.00316.06
7.1.70.0070.00716.65
7.1.60.0110.01117.73
7.1.50.0090.00816.40
7.1.40.0080.00416.11
7.1.30.0070.00415.93
7.1.20.0120.00316.09
7.1.10.0070.00716.11
7.1.00.0070.04019.30
7.0.330.0030.01015.69
7.0.320.0070.00315.71
7.0.310.0130.00315.54
7.0.300.0000.01215.38
7.0.290.0060.01015.61
7.0.280.0040.00415.42
7.0.270.0130.00015.54
7.0.260.0140.00415.27
7.0.250.0030.01315.52
7.0.240.0000.01015.69
7.0.230.0060.00915.34
7.0.220.0000.01415.46
7.0.210.0070.00715.52
7.0.200.0160.00416.09
7.0.190.0060.00615.62
7.0.180.0000.01015.40
7.0.170.0090.00315.58
7.0.160.0070.01015.59
7.0.150.0000.00915.66
7.0.140.0040.03818.88
7.0.130.0070.00715.77
7.0.120.0030.01015.39
7.0.110.0090.00315.37
7.0.100.0070.02717.74
7.0.90.0110.04317.82
7.0.80.0050.04617.80
7.0.70.0080.04417.81
7.0.60.0110.03717.89
7.0.50.0070.04018.01
7.0.40.0030.04816.93
7.0.30.0030.05016.82
7.0.20.0030.04416.84
7.0.10.0100.02816.97
7.0.00.0050.04316.88
5.6.400.0090.00614.50
5.6.390.0030.00714.49
5.6.380.0030.00614.46
5.6.370.0040.00814.46
5.6.360.0000.01414.69
5.6.350.0030.00514.75
5.6.340.0070.00714.59
5.6.330.0100.00714.54
5.6.320.0130.00314.70
5.6.310.0070.01014.85
5.6.300.0030.01114.43
5.6.290.0030.00614.23
5.6.280.0070.03817.82
5.6.270.0060.01014.32
5.6.260.0000.01414.88
5.6.250.0100.04217.63
5.6.240.0050.04017.43
5.6.230.0130.04017.55
5.6.220.0070.04617.47
5.6.210.0050.04117.51
5.6.200.0050.04717.73
5.6.190.0120.04217.70
5.6.180.0060.03817.70
5.6.170.0150.03517.81
5.6.160.0060.04617.80
5.6.150.0050.04017.67
5.6.140.0050.03917.73
5.6.130.0050.03717.78
5.6.120.0100.04217.88
5.6.110.0110.03417.67
5.6.100.0070.03817.60
5.6.90.0020.05217.82
5.6.80.0080.02817.53
5.6.70.0110.03917.25
5.6.60.0060.04217.39
5.6.50.0080.04517.39
5.6.40.0080.04617.49
5.6.30.0090.04117.45
5.6.20.0090.04017.48
5.6.10.0030.04317.46
5.6.00.0020.02917.39
5.5.380.0080.04517.24
5.5.370.0050.04117.26
5.5.360.0070.03917.61
5.5.350.0120.04317.53
5.5.340.0100.02517.54
5.5.330.0160.03517.83
5.5.320.0010.02817.80
5.5.310.0100.04017.61
5.5.300.0100.04317.62
5.5.290.0030.04217.77
5.5.280.0090.04717.71
5.5.270.0050.04617.73
5.5.260.0050.04617.63
5.5.250.0040.04117.45
5.5.240.0070.03917.22
5.5.230.0060.04017.27
5.5.220.0090.04017.20
5.5.210.0050.02917.17
5.5.200.0050.04217.30
5.5.190.0050.04217.31
5.5.180.0050.04517.23
5.5.170.0090.00614.50
5.5.160.0070.03917.36
5.5.150.0080.02617.34
5.5.140.0050.04717.34
5.5.130.0050.04617.37
5.5.120.0150.03717.36
5.5.110.0070.04117.29
5.5.100.0040.04717.30
5.5.90.0070.03017.32
5.5.80.0050.04317.19
5.5.70.0030.04417.10
5.5.60.0100.03717.22
5.5.50.0100.04017.31
5.5.40.0050.04317.30
5.5.30.0030.04517.09
5.5.20.0110.03617.31
5.5.10.0090.04017.23
5.5.00.0120.02017.30
5.4.450.0030.03216.37
5.4.440.0030.04716.37
5.4.430.0110.03816.45
5.4.420.0020.04716.32
5.4.410.0110.03716.34
5.4.400.0100.03516.32
5.4.390.0080.04116.24
5.4.380.0050.02516.24
5.4.370.0060.04416.31
5.4.360.0100.03516.17
5.4.350.0070.04116.15
5.4.340.0110.03516.17
5.4.330.0000.01213.52
5.4.320.0030.03116.31
5.4.310.0070.03916.16
5.4.300.0100.03716.37
5.4.290.0050.04016.37
5.4.280.0030.04116.28
5.4.270.0060.04016.27
5.4.260.0020.04616.30
5.4.250.0050.03816.28
5.4.240.0070.03516.27
5.4.230.0100.04016.20
5.4.220.0050.02716.30
5.4.210.0080.03716.22
5.4.200.0060.02816.29
5.4.190.0050.04016.22
5.4.180.0070.02816.23
5.4.170.0050.02016.30
5.4.160.0060.03716.29
5.4.150.0050.03816.32
5.4.140.0050.03814.96
5.4.130.0050.03814.84
5.4.120.0070.03814.92
5.4.110.0020.04114.89
5.4.100.0080.03614.97
5.4.90.0050.02315.00
5.4.80.0040.03014.97
5.4.70.0110.01814.97
5.4.60.0020.02614.99
5.4.50.0050.02114.93
5.4.40.0040.02014.90
5.4.30.0050.01814.85
5.4.20.0020.02414.91
5.4.10.0040.02314.94
5.4.00.0000.02414.61
5.3.290.0030.04214.10
5.3.280.0000.04713.99
5.3.270.0030.03014.00
5.3.260.0050.03313.98
5.3.250.0060.03814.02
5.3.240.0060.04014.04
5.3.230.0030.04313.97
5.3.220.0020.03613.96
5.3.210.0060.03713.96
5.3.200.0060.03914.05
5.3.190.0060.03813.96
5.3.180.0030.04314.04
5.3.170.0030.03914.03
5.3.160.0030.02714.04
5.3.150.0050.02014.04
5.3.140.0000.02413.96
5.3.130.0060.02313.97
5.3.120.0050.02014.04
5.3.110.0020.02413.99
5.3.100.0050.02213.76
5.3.90.0070.02013.77
5.3.80.0060.02013.65
5.3.70.0040.02413.77
5.3.60.0060.02013.76
5.3.50.0030.02313.66
5.3.40.0070.02213.73
5.3.30.0050.02313.65
5.3.20.0050.04013.54
5.3.10.0090.02213.57
5.3.00.0020.02713.59
5.2.170.0030.03312.70
5.2.160.0100.05312.70
5.2.150.0030.06012.70
5.2.140.0100.06012.70
5.2.130.0030.04012.70
5.2.120.0070.05712.70
5.2.110.0100.04312.70
5.2.100.0000.03312.70
5.2.90.0000.03712.70
5.2.80.0100.02312.70
5.2.70.0000.03312.70
5.2.60.0000.03312.70
5.2.50.0000.03312.70
5.2.40.0100.02712.70
5.2.30.0000.03012.70
5.2.20.0000.04012.70
5.2.10.0000.03712.70
5.2.00.0030.03312.70
5.1.60.0000.02712.70
5.1.50.0000.02712.70
5.1.40.0030.02312.70
5.1.30.0030.02712.70
5.1.20.0070.03312.70
5.1.10.0030.02712.70
5.1.00.0030.02712.70
5.0.50.0000.02312.70
5.0.40.0030.02012.70
5.0.30.0070.02712.70
5.0.20.0000.02012.70
5.0.10.0000.02012.70
5.0.00.0000.03312.70
4.4.90.0000.01712.70
4.4.80.0030.03012.70
4.4.70.0030.02012.70
4.4.60.0000.01712.70
4.4.50.0000.01712.70
4.4.40.0000.03012.70
4.4.30.0000.01712.70
4.4.20.0030.01712.70
4.4.10.0000.01712.70
4.4.00.0030.02312.70
4.3.110.0000.01712.70
4.3.100.0030.01312.70
4.3.90.0000.01712.70
4.3.80.0000.02712.70
4.3.70.0000.01712.70
4.3.60.0030.01312.70
4.3.50.0030.01312.70
4.3.40.0000.02312.70
4.3.30.0000.01712.70
4.3.20.0000.02712.70
4.3.10.0000.01712.70
4.3.00.0000.01312.70

preferences:
51.44 ms | 401 KiB | 5 Q