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('m') > 28 ) { $startDate->setDate($startDate->format('Y'), $startDate->format('m'), 28); } 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.0080.00618.56
8.3.50.0090.01216.35
8.3.40.0170.00318.97
8.3.30.0110.00419.08
8.3.20.0030.00520.36
8.3.10.0120.00820.63
8.3.00.0060.00319.50
8.2.180.0110.00816.61
8.2.170.0070.00722.96
8.2.160.0070.00720.37
8.2.150.0050.00524.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00022.05
8.2.110.0100.00620.57
8.2.100.0030.00918.09
8.2.90.0050.00319.19
8.2.80.0030.00517.97
8.2.70.0000.00817.75
8.2.60.0050.00317.93
8.2.50.0040.00718.07
8.2.40.0000.00818.22
8.2.30.0000.00718.09
8.2.20.0000.00817.84
8.2.10.0040.00418.02
8.2.00.0030.00517.89
8.1.280.0040.01425.92
8.1.270.0080.00023.79
8.1.260.0000.00726.35
8.1.250.0090.00928.09
8.1.240.0080.00023.79
8.1.230.0110.00019.21
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0050.00517.48
8.1.190.0060.00317.48
8.1.180.0090.00018.10
8.1.170.0030.00518.56
8.1.160.0000.00821.98
8.1.150.0000.00718.83
8.1.140.0040.00417.61
8.1.130.0030.00317.86
8.1.120.0070.00017.49
8.1.110.0040.00417.53
8.1.100.0070.00017.51
8.1.90.0040.00417.67
8.1.80.0030.00517.71
8.1.70.0000.00717.61
8.1.60.0040.00417.63
8.1.50.0050.00317.66
8.1.40.0040.00417.66
8.1.30.0030.00517.61
8.1.20.0000.00817.64
8.1.10.0050.00317.70
8.1.00.0070.00017.67
8.0.300.0060.00318.77
8.0.290.0040.00417.00
8.0.280.0050.00318.48
8.0.270.0030.00517.31
8.0.260.0080.00017.30
8.0.250.0070.00017.13
8.0.240.0030.00317.19
8.0.230.0040.00217.13
8.0.220.0000.00717.08
8.0.210.0080.00017.06
8.0.200.0030.00317.11
8.0.190.0000.00717.00
8.0.180.0080.00016.97
8.0.170.0060.00317.10
8.0.160.0000.00817.00
8.0.150.0000.00717.08
8.0.140.0040.00417.03
8.0.130.0060.00013.36
8.0.120.0000.00816.87
8.0.110.0040.00417.06
8.0.100.0000.00716.95
8.0.90.0000.00717.11
8.0.80.0060.00917.05
8.0.70.0040.00416.88
8.0.60.0040.00416.89
8.0.50.0080.00016.88
8.0.30.0100.01017.18
8.0.20.0110.01017.40
8.0.10.0040.00417.17
8.0.00.0110.01016.99
7.4.330.0050.00015.08
7.4.320.0000.00616.59
7.4.300.0060.00016.79
7.4.290.0000.00716.72
7.4.280.0080.00316.77
7.4.270.0000.00716.60
7.4.260.0030.00616.66
7.4.250.0000.00816.69
7.4.240.0000.00716.62
7.4.230.0030.00316.56
7.4.220.0090.01216.72
7.4.210.0100.01016.80
7.4.200.0040.00416.66
7.4.160.0060.01016.60
7.4.150.0070.01117.40
7.4.140.0170.00417.86
7.4.130.0150.00516.69
7.4.120.0070.01016.67
7.4.110.0070.01116.61
7.4.100.0150.00316.86
7.4.90.0160.00316.54
7.4.80.0110.00719.39
7.4.70.0030.01916.65
7.4.60.0100.00716.51
7.4.50.0030.00616.54
7.4.40.0030.01516.84
7.4.30.0050.01116.68
7.4.00.0060.01115.14
7.3.330.0000.00713.14
7.3.320.0060.00013.25
7.3.310.0000.00916.44
7.3.300.0000.00716.25
7.3.290.0000.01516.41
7.3.280.0090.01016.34
7.3.270.0150.00317.40
7.3.260.0100.00616.46
7.3.250.0080.00816.50
7.3.240.0040.01416.41
7.3.230.0200.00716.39
7.3.210.0040.01516.43
7.3.200.0090.00919.39
7.3.190.0130.01016.61
7.3.180.0170.00016.63
7.3.170.0030.01716.57
7.3.160.0050.01016.52
7.3.120.0140.00314.71
7.3.110.0050.00514.90
7.3.100.0100.00314.85
7.3.90.0070.00714.79
7.3.80.0040.01115.00
7.3.70.0000.01114.97
7.3.60.0030.01014.80
7.3.50.0090.00414.93
7.3.40.0110.00314.89
7.3.30.0070.00714.92
7.3.20.0000.01416.86
7.3.10.0070.01116.82
7.3.00.0100.00716.85
7.2.330.0140.00416.44
7.2.320.0070.01316.83
7.2.310.0030.02116.92
7.2.300.0140.01116.89
7.2.290.0060.01216.91
7.2.250.0030.01415.16
7.2.240.0090.01215.27
7.2.230.0120.00314.73
7.2.220.0060.00315.32
7.2.210.0040.01415.30
7.2.200.0030.01315.07
7.2.190.0070.01115.04
7.2.180.0090.00314.91
7.2.170.0030.01314.87
7.2.00.0000.00919.09
7.1.330.0060.00915.98
7.1.320.0030.00616.01
7.1.310.0060.00615.53
7.1.300.0040.00715.50
7.1.290.0030.01015.84
7.1.280.0000.00915.54
7.1.270.0090.00916.09
7.1.260.0040.01015.95
7.1.100.0060.00618.22
7.1.70.0030.00617.31
7.1.60.0100.01319.32
7.1.50.0110.00017.19
7.1.00.0070.07322.46
7.0.200.0000.00716.90
7.0.140.0100.07021.99
7.0.60.0130.07319.89
7.0.50.0030.04017.91
7.0.40.0000.04720.03
7.0.30.0230.04720.18
7.0.20.0330.07720.30
7.0.10.0100.08720.18
7.0.00.0070.04020.17
5.6.280.0000.07720.89
5.6.210.0030.04320.69
5.6.200.0030.07718.12
5.6.190.0100.06020.41
5.6.180.0230.04720.48
5.6.170.0370.06320.38
5.6.160.0030.07320.48
5.6.150.0100.07718.21
5.6.140.0030.05318.18
5.6.130.0100.08018.17
5.6.120.0070.08720.79
5.6.110.0030.08321.01
5.6.100.0100.03321.11
5.6.90.0130.04020.88
5.6.80.0130.07320.53
5.5.350.0100.05020.42
5.5.340.0030.08717.88
5.5.330.0130.06720.13
5.5.320.0370.07320.29
5.5.310.0300.05020.32
5.5.300.0200.06717.91
5.5.290.0100.03317.92
5.5.280.0100.07720.87
5.5.270.0100.06020.94
5.5.260.0170.07720.76
5.5.250.0070.04020.57
5.5.240.0200.07720.29
5.4.450.0130.05019.57
5.4.440.0300.03319.57
5.4.430.0400.04719.45
5.4.420.0770.00019.31
5.4.410.0630.00019.24
5.4.400.0630.00018.96
5.4.390.0630.00019.16
5.4.380.0630.00019.16
5.4.370.0600.00019.16
5.4.360.0570.00019.15
5.4.350.0670.00019.15
5.4.340.0600.00019.09
5.4.320.0040.03712.45
5.4.310.0060.03812.45
5.4.300.0070.03512.45
5.4.290.0080.03612.45
5.4.280.0070.03412.35
5.4.270.0080.03312.35
5.4.260.0060.03612.35
5.4.250.0060.03712.35
5.4.240.0060.03512.35
5.4.230.0070.03612.34
5.4.220.0030.03912.34
5.4.210.0060.03512.34
5.4.200.0060.03712.34
5.4.190.0070.03512.34
5.4.180.0080.03512.34
5.4.170.0080.03512.35
5.4.160.0030.04212.35
5.4.150.0060.03812.34
5.4.140.0070.03612.02
5.4.130.0100.03712.02
5.4.120.0100.03311.97
5.4.110.0080.03511.97
5.4.100.0070.03711.97
5.4.90.0060.04111.97
5.4.80.0110.04311.97
5.4.70.0130.05611.96
5.4.60.0110.04711.96
5.4.50.0050.04211.96
5.4.40.0050.03611.95
5.4.30.0050.03711.95
5.4.20.0080.03811.95
5.4.10.0050.03511.95
5.4.00.0040.03811.43
5.3.290.0060.04212.80
5.3.280.0060.03912.71
5.3.270.0040.04212.72
5.3.260.0050.04012.72
5.3.250.0050.03912.72
5.3.240.0040.03912.72
5.3.230.0070.03712.71
5.3.220.0050.03812.68
5.3.210.0080.04112.68
5.3.200.0110.03412.68
5.3.190.0080.04012.68
5.3.180.0050.03712.67
5.3.170.0070.03612.67
5.3.160.0050.04012.68
5.3.150.0060.03812.68
5.3.140.0050.03712.66
5.3.130.0060.03912.66
5.3.120.0060.03912.66
5.3.110.0040.04112.66
5.3.100.0050.03812.12
5.3.90.0070.03512.09
5.3.80.0040.03912.07
5.3.70.0080.03512.07
5.3.60.0040.03912.07
5.3.50.0100.03212.00
5.3.40.0050.03712.00
5.3.30.0050.03511.96
5.3.20.0050.03711.73
5.3.10.0070.03311.70
5.3.00.0050.03611.69
5.2.170.0050.0309.18
5.2.160.0040.0299.18
5.2.150.0040.0309.18
5.2.140.0090.0259.17
5.2.130.0040.0309.14
5.2.120.0060.0329.14
5.2.110.0050.0329.14
5.2.100.0020.0309.14
5.2.90.0030.0309.14
5.2.80.0030.0319.14
5.2.70.0030.0319.13
5.2.60.0050.0299.09
5.2.50.0050.0329.06
5.2.40.0010.0329.04
5.2.30.0050.0299.02
5.2.20.0050.0289.00
5.2.10.0030.0358.93
5.2.00.0040.0308.78
5.1.60.0040.0288.07
5.1.50.0060.0278.07
5.1.40.0050.0238.05
5.1.30.0070.0228.40
5.1.20.0040.0268.42
5.1.10.0040.0268.14
5.1.00.0020.0278.14
5.0.50.0020.0216.62
5.0.40.0030.0196.48
5.0.30.0030.0316.29
5.0.20.0060.0166.27
5.0.10.0040.0196.24
5.0.00.0020.0326.24
4.4.90.0040.0174.78
4.4.80.0040.0144.75
4.4.70.0040.0204.75
4.4.60.0060.0164.75
4.4.50.0030.0154.77
4.4.40.0020.0254.71
4.4.30.0020.0164.76
4.4.20.0050.0144.84
4.4.10.0020.0174.85
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0020.0154.67
4.3.90.0020.0154.63
4.3.80.0060.0214.58
4.3.70.0020.0154.63
4.3.60.0040.0134.63
4.3.50.0010.0174.63
4.3.40.0040.0224.54
4.3.30.0030.0153.28
4.3.20.0020.0163.26
4.3.10.0010.0173.22
4.3.00.0000.01313.59

preferences:
84.27 ms | 400 KiB | 5 Q