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 ((int) $startDate->format('j') > 28 ) { $startDate->modify('28th day'); } 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.70.0110.01116.75
8.3.60.0030.01018.80
8.3.50.0100.01321.15
8.3.40.0180.00419.09
8.3.30.0040.01119.07
8.3.20.0040.00420.34
8.3.10.0090.00620.66
8.3.00.0000.00819.63
8.2.180.0100.01016.60
8.2.170.0180.00322.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0090.00926.16
8.2.120.0040.00422.05
8.2.110.0100.00720.94
8.2.100.0060.00617.84
8.2.90.0040.00817.88
8.2.80.0090.00018.74
8.2.70.0040.00417.93
8.2.60.0080.00017.75
8.2.50.0090.00018.10
8.2.40.0040.00418.22
8.2.30.0050.00218.13
8.2.20.0000.00817.82
8.2.10.0060.00318.06
8.2.00.0030.00617.69
8.1.280.0120.00625.92
8.1.270.0150.00323.89
8.1.260.0070.00726.35
8.1.250.0100.00728.09
8.1.240.0000.01023.96
8.1.230.0090.00317.83
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00517.36
8.1.190.0060.00317.36
8.1.180.0060.00318.10
8.1.170.0040.00418.64
8.1.160.0040.00421.96
8.1.150.0060.00318.85
8.1.140.0040.00417.46
8.1.130.0000.00717.89
8.1.120.0000.00817.61
8.1.110.0040.00417.52
8.1.100.0000.00717.48
8.1.90.0030.00317.64
8.1.80.0000.00717.69
8.1.70.0000.00817.45
8.1.60.0000.00717.77
8.1.50.0080.00017.70
8.1.40.0040.00417.61
8.1.30.0040.00417.67
8.1.20.0080.00017.67
8.1.10.0030.00517.60
8.1.00.0040.00417.64
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0070.00018.36
8.0.270.0070.00017.20
8.0.260.0040.00417.32
8.0.250.0000.00817.14
8.0.240.0060.00017.05
8.0.230.0000.00717.18
8.0.220.0000.00817.09
8.0.210.0030.00517.15
8.0.200.0050.00217.08
8.0.190.0000.00917.07
8.0.180.0040.00417.08
8.0.170.0000.00817.08
8.0.160.0000.00717.03
8.0.150.0000.00717.06
8.0.140.0040.00416.94
8.0.130.0000.00613.51
8.0.120.0040.00416.99
8.0.110.0040.00417.02
8.0.100.0000.00717.10
8.0.90.0050.00317.21
8.0.80.0070.00717.11
8.0.70.0040.00417.18
8.0.60.0000.00817.01
8.0.50.0040.00416.96
8.0.30.0130.01117.32
8.0.20.0100.01417.40
8.0.10.0040.00417.15
8.0.00.0090.01216.76
7.4.330.0050.00015.16
7.4.320.0000.00616.57
7.4.300.0040.00416.59
7.4.290.0000.00716.60
7.4.280.0110.00016.77
7.4.270.0030.00316.64
7.4.260.0000.00716.54
7.4.250.0050.00316.62
7.4.240.0020.00616.68
7.4.230.0070.00016.54
7.4.220.0040.01716.71
7.4.210.0030.01516.83
7.4.200.0070.00016.55
7.4.160.0100.00716.65
7.4.150.0100.01017.40
7.4.140.0160.00617.86
7.4.130.0080.00916.78
7.4.120.0090.00916.79
7.4.110.0060.01116.61
7.4.100.0040.01816.84
7.4.90.0060.01216.75
7.4.80.0090.01319.39
7.4.70.0060.01716.49
7.4.60.0080.00816.63
7.4.50.0050.00316.36
7.4.40.0130.00416.62
7.4.30.0100.00616.86
7.4.10.0110.00714.93
7.4.00.0090.00615.14
7.3.330.0000.00613.19
7.3.320.0030.00313.15
7.3.310.0030.00316.26
7.3.300.0000.00716.40
7.3.290.0110.00716.44
7.3.280.0060.01116.34
7.3.270.0070.01117.40
7.3.260.0120.00516.63
7.3.250.0120.00616.65
7.3.240.0070.01016.45
7.3.230.0110.00616.56
7.3.210.0160.00916.51
7.3.200.0060.01219.39
7.3.190.0120.00616.56
7.3.180.0100.00716.83
7.3.170.0080.00816.53
7.3.160.0050.01016.71
7.3.130.0070.01014.98
7.3.120.0060.01114.86
7.3.110.0080.00914.81
7.3.100.0060.01014.95
7.3.90.0100.00214.92
7.3.80.0060.00815.13
7.3.70.0050.00814.81
7.3.60.0080.00514.80
7.3.50.0070.01014.84
7.3.40.0060.00714.80
7.3.30.0070.00814.61
7.3.20.0110.00516.79
7.3.10.0080.01216.73
7.3.00.0070.00716.65
7.2.330.0030.01516.90
7.2.320.0070.01116.72
7.2.310.0070.01116.72
7.2.300.0130.01016.87
7.2.290.0100.01416.60
7.2.260.0100.00614.67
7.2.250.0050.01315.13
7.2.240.0080.01015.03
7.2.230.0030.01015.04
7.2.220.0050.01214.86
7.2.210.0020.01315.07
7.2.200.0030.01514.90
7.2.190.0040.00914.91
7.2.180.0030.01014.90
7.2.170.0070.00714.97
7.2.160.0060.00615.03
7.2.150.0060.01016.80
7.2.140.0120.00616.97
7.2.130.0080.01216.94
7.2.120.0100.01016.89
7.2.110.0160.00716.87
7.2.100.0150.00716.95
7.2.90.0070.01216.79
7.2.80.0070.00716.75
7.2.70.0120.00816.67
7.2.60.0070.00916.67
7.2.50.0060.01316.85
7.2.40.0050.00916.88
7.2.30.0080.01116.84
7.2.20.0060.00616.86
7.2.10.0050.01016.94
7.2.00.0080.00617.75
7.1.330.0040.01115.72
7.1.320.0020.00815.75
7.1.310.0060.00515.62
7.1.300.0040.00715.93
7.1.290.0030.01515.89
7.1.280.0090.00515.83
7.1.270.0070.00515.82
7.1.260.0030.01115.92
7.1.250.0120.00515.74
7.1.240.0040.00815.75
7.1.230.0090.00615.95
7.1.220.0000.01115.95
7.1.210.0040.01115.92
7.1.200.0060.00615.91
7.1.190.0040.00715.94
7.1.180.0030.01215.91
7.1.170.0030.00715.94
7.1.160.0060.00915.88
7.1.150.0100.00315.54
7.1.140.0080.00815.71
7.1.130.0060.00615.83
7.1.120.0060.00715.84
7.1.110.0100.00315.62
7.1.100.0020.00916.91
7.1.90.0080.00015.80
7.1.80.0090.00315.87
7.1.70.0030.00616.43
7.1.60.0050.01517.50
7.1.50.0070.01216.28
7.1.40.0080.00415.60
7.1.30.0070.00716.02
7.1.20.0040.01215.75
7.1.10.0030.01315.63
7.1.00.0050.04019.18
7.0.330.0040.01115.51
7.0.320.0030.01015.58
7.0.310.0060.00615.50
7.0.300.0030.00615.59
7.0.290.0080.00315.30
7.0.280.0040.00815.58
7.0.270.0080.00415.21
7.0.260.0000.01015.48
7.0.250.0040.01115.40
7.0.240.0030.00915.35
7.0.230.0060.00615.38
7.0.220.0040.01115.57
7.0.210.0040.00415.61
7.0.200.0070.00415.96
7.0.190.0080.00415.46
7.0.180.0070.00715.39
7.0.170.0000.01315.61
7.0.160.0080.00315.47
7.0.150.0060.00315.29
7.0.140.0030.04318.77
7.0.130.0080.00315.44
7.0.120.0000.01315.66
7.0.110.0070.00715.18
7.0.100.0090.00015.53
7.0.90.0040.01115.60
7.0.80.0060.00315.57
7.0.70.0040.00815.27
7.0.60.0030.04017.69
7.0.50.0050.03316.63
7.0.40.0050.02616.91
7.0.30.0080.03016.73
7.0.20.0140.02716.86
7.0.10.0060.04616.69
7.0.00.0070.02316.72
5.6.400.0100.00014.33
5.6.390.0090.00614.34
5.6.380.0090.00614.62
5.6.370.0100.00314.54
5.6.360.0040.01214.22
5.6.350.0090.00014.49
5.6.340.0070.00714.65
5.6.330.0040.00414.66
5.6.320.0080.00814.45
5.6.310.0060.00614.76
5.6.300.0060.00614.13
5.6.290.0060.00314.45
5.6.280.0000.04417.75
5.6.270.0090.00614.39
5.6.260.0060.00614.55
5.6.250.0000.01314.83
5.6.240.0060.00914.20
5.6.230.0060.00314.36
5.6.220.0060.00914.58
5.6.210.0050.03317.73
5.6.200.0090.02516.29
5.6.190.0100.03517.50
5.6.180.0180.02117.46
5.6.170.0180.02217.45
5.6.160.0060.04317.51
5.6.150.0030.02716.37
5.6.140.0070.04416.20
5.6.130.0020.02916.30
5.6.120.0070.02517.63
5.6.110.0070.04717.79
5.6.100.0100.04117.78
5.6.90.0030.03217.67
5.6.80.0140.03917.39
5.6.70.0040.01114.25
5.6.60.0070.01114.73
5.6.50.0070.01114.29
5.6.40.0100.00714.50
5.6.30.0060.01314.37
5.6.20.0060.01314.64
5.6.10.0060.00614.36
5.6.00.0160.00014.43
5.5.380.0060.00914.17
5.5.370.0160.00014.46
5.5.360.0110.00414.45
5.5.350.0070.02717.28
5.5.340.0070.03816.12
5.5.330.0130.03717.40
5.5.320.0220.03517.40
5.5.310.0200.04017.43
5.5.300.0070.04416.09
5.5.290.0020.02816.28
5.5.280.0110.04717.53
5.5.270.0050.04517.54
5.5.260.0100.04817.36
5.5.250.0130.02117.38
5.5.240.0200.03317.29
5.5.230.0060.00914.07
5.5.220.0070.01014.27
5.5.210.0090.00614.13
5.5.200.0040.01414.09
5.5.190.0030.01314.40
5.5.180.0060.00614.38
5.5.170.0070.01114.11
5.5.160.0040.01414.26
5.5.150.0060.01314.64
5.5.140.0100.00614.43
5.5.130.0060.00914.44
5.5.120.0040.01114.22
5.5.110.0090.00614.26
5.5.100.0110.00314.25
5.5.90.0060.00314.48
5.5.80.0000.00914.23
5.5.70.0060.00614.15
5.5.60.0060.00914.32
5.5.50.0040.00714.32
5.5.40.0090.00313.95
5.5.30.0090.00914.43
5.5.20.0100.01014.55
5.5.10.0080.01214.18
5.5.00.0060.00614.50
5.4.450.0230.02715.53
5.4.440.0180.02715.54
5.4.430.0250.02515.51
5.4.420.0330.00515.48
5.4.410.0350.00015.43
5.4.400.0350.00215.34
5.4.390.0340.00415.38
5.4.380.0350.00515.40
5.4.370.0360.00215.36
5.4.360.0350.00415.35
5.4.350.0350.00515.39
5.4.340.0370.00115.36
5.4.330.0040.00711.64
5.4.320.0070.02112.05
5.4.310.0030.02412.05
5.4.300.0050.02312.05
5.4.290.0040.02412.05
5.4.280.0050.02212.00
5.4.270.0040.02212.00
5.4.260.0040.02512.00
5.4.250.0060.02112.00
5.4.240.0090.01612.00
5.4.230.0060.02011.99
5.4.220.0040.02011.99
5.4.210.0060.02011.99
5.4.200.0050.02311.99
5.4.190.0060.02511.99
5.4.180.0050.01911.99
5.4.170.0060.02112.00
5.4.160.0060.02012.00
5.4.150.0050.02111.99
5.4.140.0060.02211.84
5.4.130.0060.02011.83
5.4.120.0020.02111.81
5.4.110.0040.02311.81
5.4.100.0050.01911.81
5.4.90.0050.02111.80
5.4.80.0060.02111.80
5.4.70.0040.02311.80
5.4.60.0040.02311.80
5.4.50.0070.02011.80
5.4.40.0080.01911.80
5.4.30.0060.02011.80
5.4.20.0050.02011.80
5.4.10.0040.02211.79
5.4.00.0030.02311.54
5.3.290.0110.03612.80
5.3.280.0070.04012.71
5.3.270.0090.03912.73
5.3.260.0070.03812.72
5.3.250.0070.03712.72
5.3.240.0080.03512.72
5.3.230.0070.03612.71
5.3.220.0070.03512.68
5.3.210.0050.04012.68
5.3.200.0070.03612.68
5.3.190.0050.04112.68
5.3.180.0070.03712.68
5.3.170.0070.03712.67
5.3.160.0060.03912.67
5.3.150.0090.03512.68
5.3.140.0120.03112.66
5.3.130.0110.03312.65
5.3.120.0080.03712.66
5.3.110.0060.04212.66
5.3.100.0070.03612.12
5.3.90.0060.03612.08
5.3.80.0050.03712.07
5.3.70.0050.04112.07
5.3.60.0070.03612.06
5.3.50.0050.03812.00
5.3.40.0080.03412.00
5.3.30.0060.03511.96
5.3.20.0040.03711.73
5.3.10.0060.03511.70
5.3.00.0060.03611.69
5.2.170.0040.0309.18
5.2.160.0050.0289.18
5.2.150.0050.0309.18
5.2.140.0070.0289.18
5.2.130.0030.0309.14
5.2.120.0040.0299.14
5.2.110.0080.0269.14
5.2.100.0060.0319.14
5.2.90.0080.0269.14
5.2.80.0040.0309.14
5.2.70.0060.0289.14
5.2.60.0020.0329.09
5.2.50.0040.0309.06
5.2.40.0070.0269.04
5.2.30.0090.0319.01
5.2.20.0060.0279.00
5.2.10.0050.0288.93
5.2.00.0060.0288.79
5.1.60.0040.0238.07
5.1.50.0070.0218.06
5.1.40.0070.0218.05
5.1.30.0050.0258.40
5.1.20.0060.0258.41
5.1.10.0040.0268.14
5.1.00.0040.0258.14
5.0.50.0030.0216.62
5.0.40.0030.0196.49
5.0.30.0060.0296.29
5.0.20.0050.0176.27
5.0.10.0030.0206.25
5.0.00.0040.0306.23
4.4.90.0030.0154.78
4.4.80.0040.0144.76
4.4.70.0030.0154.76
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0020.0154.76
4.4.20.0030.0154.84
4.4.10.0020.0164.84
4.4.00.0030.0244.76
4.3.110.0020.0164.67
4.3.100.0000.0174.66
4.3.90.0030.0144.64
4.3.80.0040.0234.59
4.3.70.0040.0134.63
4.3.60.0030.0144.63
4.3.50.0040.0144.63
4.3.40.0050.0214.54
4.3.30.0010.0193.29
4.3.20.0030.0153.26
4.3.10.0010.0173.22
4.3.00.0070.01313.59

preferences:
59.35 ms | 401 KiB | 5 Q