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 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.00018.41
8.3.50.0120.01021.07
8.3.40.0140.00719.09
8.3.30.0000.01419.17
8.3.20.0180.00020.18
8.3.10.0030.01620.73
8.3.00.0040.00419.63
8.2.180.0000.01616.63
8.2.170.0160.00622.96
8.2.160.0100.00320.29
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00322.05
8.2.110.0080.00320.47
8.2.100.0090.00318.09
8.2.90.0080.00019.05
8.2.80.0030.00517.97
8.2.70.0040.00417.63
8.2.60.0050.00317.50
8.2.50.0030.00818.07
8.2.40.0060.00318.09
8.2.30.0030.00518.12
8.2.20.0030.00517.69
8.2.10.0080.00018.03
8.2.00.0000.00817.74
8.1.280.0080.00825.92
8.1.270.0080.00822.19
8.1.260.0080.00026.35
8.1.250.0060.00628.09
8.1.240.0090.00023.84
8.1.230.0120.00017.76
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0000.01017.13
8.1.180.0000.00818.10
8.1.170.0040.00418.71
8.1.160.0070.00022.08
8.1.150.0040.00418.93
8.1.140.0050.00317.63
8.1.130.0070.00017.94
8.1.120.0040.00417.63
8.1.110.0030.00517.48
8.1.100.0040.00417.59
8.1.90.0070.00017.63
8.1.80.0040.00417.54
8.1.70.0000.00717.65
8.1.60.0080.00017.72
8.1.50.0030.00617.60
8.1.40.0040.00417.53
8.1.30.0040.00417.73
8.1.20.0000.00917.75
8.1.10.0080.00017.68
8.1.00.0040.00417.61
8.0.300.0070.00018.77
8.0.290.0070.00017.00
8.0.280.0000.00718.47
8.0.270.0070.00017.26
8.0.260.0000.00717.25
8.0.250.0030.00317.15
8.0.240.0000.00617.07
8.0.230.0080.00017.05
8.0.220.0070.00017.10
8.0.210.0040.00417.02
8.0.200.0080.00017.17
8.0.190.0030.00617.15
8.0.180.0050.00317.09
8.0.170.0060.00317.18
8.0.160.0050.00217.23
8.0.150.0000.00716.91
8.0.140.0030.00517.09
8.0.130.0060.00013.47
8.0.120.0080.00017.07
8.0.110.0040.00417.05
8.0.100.0000.00716.96
8.0.90.0040.00416.98
8.0.80.0130.00317.00
8.0.70.0000.00717.04
8.0.60.0050.00317.02
8.0.50.0000.00716.97
8.0.30.0140.00817.42
8.0.20.0150.00817.40
8.0.10.0040.00417.27
8.0.00.0070.01317.05
7.4.330.0000.00615.21
7.4.320.0000.00616.76
7.4.300.0000.00616.79
7.4.290.0030.00516.65
7.4.280.0040.00716.77
7.4.270.0000.00716.60
7.4.260.0000.00716.61
7.4.250.0050.00216.75
7.4.240.0040.00316.71
7.4.230.0000.00716.64
7.4.220.0150.00416.79
7.4.210.0110.00716.79
7.4.200.0040.00416.45
7.4.160.0100.00716.67
7.4.150.0160.00317.40
7.4.140.0150.00517.86
7.4.130.0110.00616.62
7.4.120.0100.00916.63
7.4.110.0100.00716.75
7.4.100.0070.01116.95
7.4.90.0070.01016.68
7.4.80.0080.00819.39
7.4.70.0070.01716.82
7.4.60.0070.01316.73
7.4.50.0040.00416.56
7.4.40.0000.01716.87
7.4.30.0030.01316.56
7.4.00.0090.00815.21
7.3.330.0070.00013.26
7.3.320.0000.00513.30
7.3.310.0000.00716.38
7.3.300.0000.00716.30
7.3.290.0090.00916.34
7.3.280.0070.00816.35
7.3.270.0150.00317.40
7.3.260.0120.00616.56
7.3.250.0080.01016.58
7.3.240.0090.00916.56
7.3.230.0140.01016.40
7.3.210.0090.01316.35
7.3.200.0090.01119.39
7.3.190.0120.01016.55
7.3.180.0100.00616.45
7.3.170.0030.01316.50
7.3.160.0090.00616.44
7.3.120.0070.01015.05
7.3.110.0060.01315.02
7.3.100.0100.01014.70
7.3.90.0110.00314.93
7.3.80.0030.01314.91
7.3.70.0110.00415.00
7.3.60.0000.01315.00
7.3.50.0100.00315.04
7.3.40.0070.00715.07
7.3.30.0070.00714.69
7.3.20.0120.00016.81
7.3.10.0050.00516.69
7.3.00.0030.00816.68
7.2.330.0090.00916.64
7.2.320.0070.01016.61
7.2.310.0180.00316.67
7.2.300.0150.00816.60
7.2.290.0140.01216.69
7.2.250.0110.00715.00
7.2.240.0060.01215.11
7.2.230.0070.00714.91
7.2.220.0130.00314.83
7.2.210.0040.00714.98
7.2.200.0000.01514.97
7.2.190.0000.01515.14
7.2.180.0000.01315.12
7.2.170.0060.00915.08
7.2.160.0030.00915.07
7.2.150.0100.00017.09
7.2.140.0060.00317.15
7.2.130.0050.01116.72
7.2.120.0080.00517.02
7.2.110.0030.00717.04
7.2.100.0030.01016.96
7.2.90.0050.00517.10
7.2.80.0020.01117.03
7.2.70.0090.00717.07
7.2.60.0060.00616.91
7.2.50.0070.00617.05
7.2.40.0100.00717.03
7.2.30.0070.00717.00
7.2.20.0100.00417.02
7.2.10.0070.00516.95
7.2.00.0050.00717.82
7.1.330.0060.00615.81
7.1.320.0030.00916.02
7.1.310.0090.00915.71
7.1.300.0030.00915.72
7.1.290.0030.00915.76
7.1.280.0030.00615.84
7.1.270.0060.00615.52
7.1.260.0120.00315.64
7.1.250.0090.00515.79
7.1.240.0060.00616.07
7.1.230.0030.01015.98
7.1.220.0040.01115.83
7.1.210.0070.00715.46
7.1.200.0060.00915.69
7.1.190.0000.01015.81
7.1.180.0050.00315.93
7.1.170.0000.01715.77
7.1.160.0090.00915.75
7.1.150.0030.01015.82
7.1.140.0060.00615.70
7.1.130.0040.01115.64
7.1.120.0070.00715.87
7.1.110.0030.01016.15
7.1.100.0080.00617.14
7.1.90.0000.01515.65
7.1.80.0030.01015.73
7.1.70.0050.00516.46
7.1.60.0130.00617.54
7.1.50.0050.01016.43
7.1.40.0030.01015.87
7.1.30.0090.00615.64
7.1.20.0100.00315.76
7.1.10.0080.00015.77
7.1.00.0050.04219.09
7.0.330.0030.00615.67
7.0.320.0080.00615.20
7.0.310.0070.00715.70
7.0.300.0030.00915.25
7.0.290.0030.01115.57
7.0.280.0090.00615.39
7.0.270.0080.00415.42
7.0.260.0000.01115.66
7.0.250.0100.00315.55
7.0.240.0080.00415.46
7.0.230.0030.01315.17
7.0.220.0060.01015.69
7.0.210.0040.01115.65
7.0.200.0040.00716.26
7.0.190.0060.00615.59
7.0.180.0060.00615.61
7.0.170.0060.00815.53
7.0.160.0070.00715.61
7.0.150.0090.00415.61
7.0.140.0070.03818.69
7.0.130.0040.01215.38
7.0.120.0000.01415.63
7.0.110.0030.01015.33
7.0.100.0040.00415.59
7.0.90.0090.00615.60
7.0.80.0030.00515.56
7.0.70.0000.01115.60
7.0.60.0030.02717.73
7.0.50.0090.04216.81
7.0.40.0060.02316.85
7.0.30.0080.02816.92
7.0.20.0150.03216.80
7.0.10.0120.04117.01
7.0.00.0070.02316.88
5.6.400.0050.00614.68
5.6.390.0030.01314.53
5.6.380.0040.01114.82
5.6.370.0070.01014.75
5.6.360.0000.01714.52
5.6.350.0030.01014.75
5.6.340.0040.00714.65
5.6.330.0060.00914.53
5.6.320.0020.01114.62
5.6.310.0030.00814.50
5.6.300.0070.00714.46
5.6.290.0040.01114.68
5.6.280.0050.03917.94
5.6.270.0090.00314.44
5.6.260.0000.01514.68
5.6.250.0070.00714.69
5.6.240.0070.00714.52
5.6.230.0030.01114.27
5.6.220.0090.00614.63
5.6.210.0070.03517.52
5.6.200.0020.02516.35
5.6.190.0030.04517.51
5.6.180.0130.02817.65
5.6.170.0190.02717.52
5.6.160.0100.04017.55
5.6.150.0080.04116.24
5.6.140.0050.04816.20
5.6.130.0090.02816.31
5.6.120.0070.04217.74
5.6.110.0100.04417.64
5.6.100.0050.04817.71
5.6.90.0110.04617.81
5.6.80.0070.04417.38
5.6.70.0070.00714.44
5.6.60.0000.01514.56
5.6.50.0060.00314.09
5.6.40.0030.00914.40
5.6.30.0130.00314.46
5.6.20.0040.01114.23
5.6.10.0080.00414.22
5.6.00.0000.01414.54
5.5.380.0040.01114.31
5.5.370.0060.00314.33
5.5.360.0060.00614.63
5.5.350.0080.03517.37
5.5.340.0080.02216.06
5.5.330.0030.03717.37
5.5.320.0170.04517.38
5.5.310.0150.04017.49
5.5.300.0050.04516.10
5.5.290.0040.02416.09
5.5.280.0050.04217.61
5.5.270.0030.04117.46
5.5.260.0080.04317.59
5.5.250.0130.02117.34
5.5.240.0170.03717.19
5.5.230.0070.00714.00
5.5.220.0120.00314.68
5.5.210.0030.00914.41
5.5.200.0060.00814.21
5.5.190.0040.00814.30
5.5.180.0000.01314.47
5.5.170.0000.01114.08
5.5.160.0000.01414.44
5.5.150.0000.01414.24
5.5.140.0030.00914.43
5.5.130.0030.01014.49
5.5.120.0080.00814.21
5.5.110.0030.00914.66
5.5.100.0060.01314.32
5.5.90.0060.01214.45
5.5.80.0040.01114.22
5.5.70.0030.01314.15
5.5.60.0130.00014.53
5.5.50.0060.00314.36
5.5.40.0060.00614.33
5.5.30.0070.00714.33
5.5.20.0000.01014.27
5.5.10.0120.00014.23
5.5.00.0030.01314.09
5.4.450.0220.02415.33
5.4.440.0170.01715.30
5.4.430.0020.02015.44
5.4.420.0350.00315.19
5.4.410.0330.00315.13
5.4.400.0350.00315.13
5.4.390.0320.00415.10
5.4.380.0350.00315.02
5.4.370.0350.00215.14
5.4.360.0320.00315.08
5.4.350.0340.00415.12
5.4.340.0340.00514.98
5.4.330.0000.00811.25
5.4.320.0060.02111.75
5.4.310.0040.02111.82
5.4.300.0060.02011.79
5.4.290.0040.02411.73
5.4.280.0030.02211.63
5.4.270.0080.01911.67
5.4.260.0080.01911.71
5.4.250.0100.01811.74
5.4.240.0070.02211.74
5.4.230.0040.02311.62
5.4.220.0060.02111.82
5.4.210.0040.02211.77
5.4.200.0080.01811.57
5.4.190.0060.02011.59
5.4.180.0070.02011.76
5.4.170.0040.02211.68
5.4.160.0050.02211.71
5.4.150.0060.02111.67
5.4.140.0080.02111.57
5.4.130.0040.02411.44
5.4.120.0050.02211.42
5.4.110.0070.02511.38
5.4.100.0030.02311.55
5.4.90.0050.02311.49
5.4.80.0040.02411.39
5.4.70.0080.02011.53
5.4.60.0040.02411.46
5.4.50.0050.02211.52
5.4.40.0040.02611.46
5.4.30.0060.02111.42
5.4.20.0020.02511.53
5.4.10.0070.02011.47
5.4.00.0050.02211.28
5.3.290.0050.03912.80
5.3.280.0050.03812.71
5.3.270.0070.04312.72
5.3.260.0090.03612.72
5.3.250.0050.03712.72
5.3.240.0070.03512.72
5.3.230.0060.03712.71
5.3.220.0040.03812.68
5.3.210.0090.03512.68
5.3.200.0050.03712.68
5.3.190.0090.03412.67
5.3.180.0050.04012.67
5.3.170.0060.03612.67
5.3.160.0070.03512.67
5.3.150.0060.03612.67
5.3.140.0080.03412.66
5.3.130.0070.03712.66
5.3.120.0100.03512.66
5.3.110.0070.03812.66
5.3.100.0040.04112.12
5.3.90.0050.03612.08
5.3.80.0070.03412.08
5.3.70.0050.03712.08
5.3.60.0030.03912.07
5.3.50.0080.03312.00
5.3.40.0090.03312.00
5.3.30.0060.03411.96
5.3.20.0050.03511.73
5.3.10.0070.03311.70
5.3.00.0000.04111.70
5.2.170.0060.0299.18
5.2.160.0030.0309.18
5.2.150.0030.0319.18
5.2.140.0050.0309.18
5.2.130.0050.0299.14
5.2.120.0070.0309.14
5.2.110.0070.0299.14
5.2.100.0060.0339.14
5.2.90.0060.0289.14
5.2.80.0050.0299.14
5.2.70.0040.0319.13
5.2.60.0060.0329.09
5.2.50.0040.0309.06
5.2.40.0100.0239.04
5.2.30.0030.0319.02
5.2.20.0040.0299.01
5.2.10.0040.0298.93
5.2.00.0040.0298.78
5.1.60.0060.0218.07
5.1.50.0020.0268.06
5.1.40.0040.0248.05
5.1.30.0050.0348.40
5.1.20.0070.0238.42
5.1.10.0040.0268.14
5.1.00.0050.0248.14
5.0.50.0040.0196.62
5.0.40.0040.0186.49
5.0.30.0050.0296.29
5.0.20.0040.0186.27
5.0.10.0030.0196.25
5.0.00.0020.0316.23
4.4.90.0030.0154.78
4.4.80.0010.0164.76
4.4.70.0000.0174.75
4.4.60.0040.0144.76
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0030.0154.76
4.4.20.0030.0154.84
4.4.10.0040.0144.84
4.4.00.0020.0254.76
4.3.110.0030.0154.66
4.3.100.0000.0174.67
4.3.90.0030.0154.63
4.3.80.0030.0244.58
4.3.70.0050.0124.63
4.3.60.0030.0144.62
4.3.50.0050.0144.63
4.3.40.0020.0264.54
4.3.30.0050.0143.29
4.3.20.0030.0173.26
4.3.10.0020.0163.22
4.3.00.0170.02013.59

preferences:
44.3 ms | 401 KiB | 5 Q