3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = new \DateTime(); $startDate->setDate(2014, 01, 30); $startDate->setTime(0, 0, 0); var_dump($startDate); if ($startDate->format('m') > 28 ) { $startDate->modify('28th day of the month'); } var_dump($startDate); /* $nextMonth = clone $startDate; $nextMonth->modify('+ 14 days'); $nextMonth->setDate($nextMonth->format('Y'), $nextMonth->format('m'), $nextMonth->format('t')); // $nextMonth->modify('last day of the month'); var_dump($nextMonth); $startDate->add(new DateInterval(sprintf('P%dD', $startDate->format('t')))); $startDate->sub(new DateInterval('P1D')); $startDate->setTime(23, 59, 59); while ($startDate >= $nextMonth) { $startDate->sub(new DateInterval('P1D')); } var_dump($startDate); $newDate = new \DateTime(); $newDate->setDate(2014, 02, 27); $newDate->setTime(23, 59, 59); var_dump($newDate->getTimestamp() == $startDate->getTimestamp()); */

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.0070.01121.08
8.3.40.0140.00718.79
8.3.30.0070.00719.13
8.3.20.0180.00020.39
8.3.10.0090.00020.66
8.3.00.0050.00319.38
8.2.180.0120.00617.00
8.2.170.0090.00622.96
8.2.160.0060.00920.39
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00322.23
8.2.110.0090.00020.53
8.2.100.0130.00018.09
8.2.90.0080.00019.30
8.2.80.0030.00517.97
8.2.70.0030.00517.75
8.2.60.0050.00318.04
8.2.50.0000.01118.07
8.2.40.0080.00018.28
8.2.30.0000.00818.20
8.2.20.0030.00617.75
8.2.10.0000.00717.99
8.2.00.0000.00917.87
8.1.280.0000.01825.92
8.1.270.0040.00422.18
8.1.260.0070.00726.35
8.1.250.0180.00028.09
8.1.240.0160.00623.85
8.1.230.0070.00418.80
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0000.00817.48
8.1.180.0050.00318.10
8.1.170.0030.00518.43
8.1.160.0000.00721.98
8.1.150.0040.00418.86
8.1.140.0040.00417.56
8.1.130.0030.00317.80
8.1.120.0050.00217.64
8.1.110.0000.00817.61
8.1.100.0040.00417.68
8.1.90.0050.00217.64
8.1.80.0070.00017.61
8.1.70.0070.00017.51
8.1.60.0000.00817.69
8.1.50.0030.00617.67
8.1.40.0090.00017.55
8.1.30.0030.00617.74
8.1.20.0000.00717.71
8.1.10.0040.00417.60
8.1.00.0080.00017.62
8.0.300.0020.00518.77
8.0.290.0000.00917.00
8.0.280.0070.00018.59
8.0.270.0030.00317.35
8.0.260.0060.00017.34
8.0.250.0030.00317.17
8.0.240.0030.00317.09
8.0.230.0030.00317.20
8.0.220.0040.00417.12
8.0.210.0040.00417.09
8.0.200.0000.00617.17
8.0.190.0030.00517.15
8.0.180.0040.00417.18
8.0.170.0040.00417.09
8.0.160.0000.00717.23
8.0.150.0040.00417.08
8.0.140.0000.00816.95
8.0.130.0060.00313.45
8.0.120.0040.00417.05
8.0.110.0030.00517.07
8.0.100.0030.00516.88
8.0.90.0080.00017.04
8.0.80.0060.01717.09
8.0.70.0000.00716.88
8.0.60.0040.00417.07
8.0.50.0000.00717.01
8.0.30.0150.00917.17
8.0.20.0050.01417.45
8.0.10.0050.00317.18
8.0.00.0160.00216.93
7.4.330.0000.00515.03
7.4.320.0000.00616.67
7.4.300.0030.00316.65
7.4.290.0070.00016.78
7.4.280.0060.00316.65
7.4.270.0080.00016.75
7.4.260.0030.00316.64
7.4.250.0050.00316.75
7.4.240.0030.00316.55
7.4.230.0000.00716.74
7.4.220.0110.00716.77
7.4.210.0130.01016.52
7.4.200.0050.00316.55
7.4.160.0100.00616.65
7.4.150.0160.00317.40
7.4.140.0140.00717.86
7.4.130.0110.00616.65
7.4.120.0070.01116.58
7.4.110.0120.00616.78
7.4.100.0110.00716.70
7.4.90.0120.00616.59
7.4.80.0090.00919.39
7.4.70.0130.01016.62
7.4.60.0110.00416.63
7.4.50.0080.00016.57
7.4.40.0160.00916.88
7.4.30.0030.01416.73
7.4.00.0090.00614.88
7.3.330.0060.00013.12
7.3.320.0000.00613.26
7.3.310.0070.00016.15
7.3.300.0070.00016.31
7.3.290.0000.01516.36
7.3.280.0070.01016.29
7.3.270.0070.01117.40
7.3.260.0000.01616.58
7.3.250.0100.01016.52
7.3.240.0150.00316.50
7.3.230.0120.00616.44
7.3.210.0110.00716.35
7.3.200.0130.00719.39
7.3.190.0090.01316.62
7.3.180.0060.01016.56
7.3.170.0170.00316.65
7.3.160.0030.01416.39
7.3.10.0100.00616.65
7.3.00.0110.00416.88
7.2.330.0120.00616.57
7.2.320.0110.01116.74
7.2.310.0070.01016.89
7.2.300.0130.00916.77
7.2.290.0070.01616.62
7.2.130.0090.00616.91
7.2.120.0040.00816.88
7.2.110.0050.00916.83
7.2.100.0040.00816.89
7.2.90.0050.00816.90
7.2.80.0070.00816.97
7.2.70.0050.00916.95
7.2.60.0070.00616.79
7.2.50.0090.00516.99
7.2.40.0040.01017.00
7.2.30.0070.00616.79
7.2.20.0030.01216.98
7.2.10.0070.00617.01
7.2.00.0060.00617.55
7.1.250.0040.00815.92
7.1.240.0050.00515.70
7.1.230.0030.00915.99
7.1.220.0000.01016.02
7.1.210.0040.00716.08
7.1.200.0100.01015.93
7.1.190.0060.00315.97
7.1.180.0100.00715.76
7.1.170.0030.00715.99
7.1.160.0060.00615.89
7.1.150.0040.00415.99
7.1.140.0000.01315.94
7.1.130.0050.00515.96
7.1.120.0030.01015.77
7.1.110.0030.01215.69
7.1.100.0060.00717.03
7.1.90.0070.00715.83
7.1.80.0070.00415.67
7.1.70.0080.00716.43
7.1.60.0090.00917.60
7.1.50.0110.00516.52
7.1.40.0000.00915.73
7.1.30.0070.00715.95
7.1.20.0040.00415.61
7.1.10.0060.00315.85
7.1.00.0050.03819.00
7.0.330.0000.00915.57
7.0.320.0040.00415.50
7.0.310.0030.00715.34
7.0.300.0040.01115.31
7.0.290.0030.00715.46
7.0.280.0030.01015.61
7.0.270.0030.01015.66
7.0.260.0040.00715.56
7.0.250.0100.00315.25
7.0.240.0030.01215.53
7.0.230.0030.00815.45
7.0.220.0030.00315.74
7.0.210.0090.00315.51
7.0.200.0020.01016.07
7.0.190.0070.00715.62
7.0.180.0030.01015.45
7.0.170.0050.00515.39
7.0.160.0030.01015.50
7.0.150.0120.00015.67
7.0.140.0070.03518.78
7.0.130.0100.00315.33
7.0.120.0040.00415.50
7.0.110.0090.00315.38
7.0.100.0060.00915.45
7.0.90.0000.01415.64
7.0.80.0090.00315.65
7.0.70.0040.00915.62
7.0.60.0100.04118.65
7.0.50.0060.03616.62
7.0.40.0090.03516.79
7.0.30.0150.04516.77
7.0.20.0170.04016.97
7.0.10.0080.04316.80
7.0.00.0070.02616.91
5.6.380.0060.00914.54
5.6.370.0060.00614.37
5.6.360.0030.00714.63
5.6.350.0050.00314.50
5.6.340.0040.00714.61
5.6.330.0040.01114.50
5.6.320.0040.00714.47
5.6.310.0040.00714.77
5.6.300.0070.00714.40
5.6.290.0030.01014.41
5.6.280.0080.04017.88
5.6.270.0040.00714.53
5.6.260.0070.00314.51
5.6.250.0080.00014.30
5.6.240.0030.01014.48
5.6.230.0030.01014.63
5.6.220.0090.00414.38
5.6.210.0100.04217.45
5.6.200.0070.03716.18
5.6.190.0030.03917.51
5.6.180.0180.02817.64
5.6.170.0170.03117.42
5.6.160.0080.02817.51
5.6.150.0120.01816.25
5.6.140.0070.04216.37
5.6.130.0070.04216.30
5.6.120.0030.03317.70
5.6.110.0080.03617.73
5.6.100.0070.04317.79
5.6.90.0050.02317.63
5.6.80.0030.02617.39
5.6.70.0070.00314.39
5.6.60.0090.00314.41
5.6.50.0100.00314.16
5.6.40.0080.00314.47
5.6.30.0070.00714.47
5.6.20.0030.00714.67
5.6.10.0100.00314.61
5.6.00.0030.01014.36
5.5.380.0040.00411.18
5.5.370.0030.00311.27
5.5.360.0060.00311.37
5.5.350.0080.04315.80
5.5.340.0030.03014.66
5.5.330.0050.04415.85
5.5.320.0230.03715.83
5.5.310.0180.04215.76
5.5.300.0070.04014.57
5.5.290.0020.04814.62
5.5.280.0070.04316.01
5.5.270.0050.02515.94
5.5.260.0030.03515.95
5.5.250.0110.03816.05
5.5.240.0030.02415.72
5.5.230.0040.00411.18
5.5.220.0000.00611.18
5.5.210.0040.00411.18
5.5.200.0000.00711.18
5.5.190.0000.00711.18
5.5.180.0040.00411.18
5.5.170.0040.00411.24
5.5.160.0050.00011.27
5.5.150.0030.00711.32
5.5.140.0000.00611.18
5.5.130.0060.00611.18
5.5.120.0060.00611.18
5.5.110.0080.00011.18
5.5.100.0050.00311.18
5.5.90.0000.00811.18
5.5.80.0080.00611.18
5.5.70.0090.00011.36
5.5.60.0000.00811.18
5.5.50.0040.00411.18
5.5.40.0080.00011.18
5.5.30.0060.00311.18
5.5.20.0060.00311.18
5.5.10.0000.00611.18
5.5.00.0030.00711.18
5.4.450.0300.03015.41
5.4.440.0200.03315.19
5.4.430.0230.03215.27
5.4.420.0180.02515.27
5.4.410.0180.02215.15
5.4.400.0160.01715.05
5.4.390.0250.03815.22
5.4.380.0180.03915.17
5.4.370.0120.02415.14
5.4.360.0170.02815.17
5.4.350.0260.03315.03
5.4.340.0180.02315.14
5.4.330.0040.00711.18
5.4.320.0130.02715.07
5.4.310.0250.03415.16
5.4.300.0150.02215.14
5.4.290.0190.03315.21
5.4.280.0160.02015.11
5.4.270.0270.03215.17
5.4.260.0170.02515.11
5.4.250.0250.03715.13
5.4.240.0180.02815.10
5.4.230.0220.03615.10
5.4.220.0170.02015.11
5.4.210.0160.02015.16
5.4.200.0220.03615.18
5.4.190.0230.01815.22
5.4.180.0180.02415.10
5.4.170.0180.04015.12
5.4.160.0200.02315.14
5.4.150.0310.03315.16
5.4.140.0150.02913.81
5.4.130.0230.03213.74
5.4.120.0230.03413.67
5.4.110.0220.03013.82
5.4.100.0150.02013.81
5.4.90.0230.01613.78
5.4.80.0230.03513.85
5.4.70.0220.02713.79
5.4.60.0180.02013.71
5.4.50.0170.03213.66
5.4.40.0170.02213.75
5.4.30.0170.03013.76
5.4.20.0250.03213.85
5.4.10.0160.02113.80
5.4.00.0160.02013.43
5.3.290.0210.03412.88
5.3.280.0130.02512.84
5.3.270.0160.02112.86
5.3.260.0100.02812.87
5.3.250.0210.03512.93
5.3.240.0260.03512.86
5.3.230.0140.04412.87
5.3.220.0190.02212.84
5.3.210.0190.02412.84
5.3.200.0170.02812.84
5.3.190.0220.02512.84
5.3.180.0170.02512.83
5.3.170.0180.03112.86
5.3.160.0200.03512.76
5.3.150.0200.02512.91
5.3.140.0120.02512.80
5.3.130.0200.02012.83
5.3.120.0190.02012.82
5.3.110.0160.03212.84
5.3.100.0140.02012.61
5.3.90.0120.02112.55
5.3.80.0120.02212.51
5.3.70.0140.02012.56
5.3.60.0190.01512.55
5.3.50.0130.02012.52
5.3.40.0160.01712.52
5.3.30.0150.01912.52
5.3.20.0170.02012.42
5.3.10.0160.01812.38
5.3.00.0170.03512.38
5.2.170.0100.01611.12
5.2.160.0130.01311.11
5.2.150.0080.01711.13
5.2.140.0100.01911.13
5.2.130.0120.02111.13
5.2.120.0150.02611.09
5.2.110.0150.03311.19
5.2.100.0130.01811.12
5.2.90.0100.01611.10
5.2.80.0200.03011.12
5.2.70.0110.01811.10
5.2.60.0120.02711.06
5.2.50.0220.01311.03
5.2.40.0110.01611.08
5.2.30.0130.01711.04
5.2.20.0100.01411.06
5.2.10.0130.01511.01
5.2.00.0120.01710.95
5.1.60.0080.01610.59
5.1.50.0100.01310.54
5.1.40.0100.01510.58
5.1.30.0080.01310.75
5.1.20.0140.01210.80
5.1.10.0090.01310.62
5.1.00.0090.01310.62
5.0.50.0060.0109.88
5.0.40.0050.0119.87
5.0.30.0030.0189.69
5.0.20.0040.0149.67
5.0.10.0070.0129.74
5.0.00.0020.0199.64
4.4.90.0070.0079.45
4.4.80.0040.0139.45
4.4.70.0050.0109.45
4.4.60.0040.0089.45
4.4.50.0050.0119.45
4.4.40.0060.0139.45
4.4.30.0050.0089.45
4.4.20.0070.0089.45
4.4.10.0070.0089.45
4.4.00.0030.0159.45
4.3.110.0020.0119.45
4.3.100.0050.0089.45
4.3.90.0030.0109.45
4.3.80.0050.0129.45
4.3.70.0020.0119.45
4.3.60.0120.0039.45
4.3.50.0030.0099.45
4.3.40.0050.0139.45
4.3.30.0020.0109.45
4.3.20.0010.0109.45
4.3.10.0000.0129.45
4.3.00.0050.0089.45

preferences:
41.59 ms | 401 KiB | 5 Q