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->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.0110.00418.43
8.3.50.0140.00621.33
8.3.40.0180.00418.94
8.3.30.0070.00719.13
8.3.20.0040.00420.37
8.3.10.0040.00420.48
8.3.00.0040.00419.25
8.2.180.0160.00316.62
8.2.170.0070.00722.96
8.2.160.0070.00720.52
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0070.01026.16
8.2.120.0180.00022.14
8.2.110.0060.00320.31
8.2.100.0080.00318.16
8.2.90.0000.00819.02
8.2.80.0040.00417.97
8.2.70.0090.00017.75
8.2.60.0030.00717.68
8.2.50.0090.00218.07
8.2.40.0080.00018.15
8.2.30.0030.00517.97
8.2.20.0040.00417.78
8.2.10.0040.00417.96
8.2.00.0030.00617.85
8.1.280.0140.00425.92
8.1.270.0040.00423.91
8.1.260.0000.00726.35
8.1.250.0120.00628.09
8.1.240.0050.00523.91
8.1.230.0110.00019.22
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0040.00418.71
8.1.160.0040.00421.98
8.1.150.0000.00718.79
8.1.140.0000.00817.62
8.1.130.0000.00717.83
8.1.120.0080.00017.68
8.1.110.0000.00717.64
8.1.100.0000.00717.65
8.1.90.0040.00417.56
8.1.80.0070.00017.66
8.1.70.0000.00717.63
8.1.60.0060.00317.74
8.1.50.0030.00617.71
8.1.40.0000.00817.56
8.1.30.0000.00817.71
8.1.20.0030.00517.78
8.1.10.0000.00717.64
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0070.00017.00
8.0.280.0000.00718.34
8.0.270.0000.00717.23
8.0.260.0000.00617.21
8.0.250.0000.00717.12
8.0.240.0000.00617.14
8.0.230.0070.00017.18
8.0.220.0070.00016.96
8.0.210.0000.00817.10
8.0.200.0000.00617.13
8.0.190.0030.00516.99
8.0.180.0000.00716.98
8.0.170.0030.00616.98
8.0.160.0070.00017.00
8.0.150.0050.00217.02
8.0.140.0040.00416.89
8.0.130.0000.00813.35
8.0.120.0050.00216.93
8.0.110.0040.00416.97
8.0.100.0000.00717.09
8.0.90.0050.00517.11
8.0.80.0090.00616.94
8.0.70.0040.00417.00
8.0.60.0040.00416.98
8.0.50.0040.00416.93
8.0.30.0110.00817.34
8.0.20.0110.01217.40
8.0.10.0000.00717.11
8.0.00.0180.00616.80
7.4.330.0030.00315.26
7.4.320.0030.00316.64
7.4.300.0030.00316.68
7.4.290.0020.00516.68
7.4.280.0030.00616.80
7.4.270.0000.00716.67
7.4.260.0000.00716.67
7.4.250.0000.00716.73
7.4.240.0020.00616.70
7.4.230.0030.00316.86
7.4.220.0170.00316.72
7.4.210.0110.00316.74
7.4.200.0050.00316.47
7.4.160.0000.01716.71
7.4.150.0040.01617.40
7.4.140.0100.00917.86
7.4.130.0110.00916.53
7.4.120.0100.00716.63
7.4.110.0070.01016.72
7.4.100.0180.00016.79
7.4.90.0090.00916.86
7.4.80.0070.01019.39
7.4.70.0100.00916.61
7.4.60.0100.01316.79
7.4.50.0000.00816.55
7.4.40.0130.00316.36
7.4.30.0070.01116.82
7.4.00.0060.00615.38
7.3.330.0060.00013.08
7.3.320.0050.00013.11
7.3.310.0030.00316.40
7.3.300.0000.00716.40
7.3.290.0030.01816.39
7.3.280.0080.01216.33
7.3.270.0150.00317.40
7.3.260.0100.00616.44
7.3.250.0070.00916.57
7.3.240.0130.00616.53
7.3.230.0120.00416.43
7.3.210.0150.00316.50
7.3.200.0040.01319.39
7.3.190.0170.00016.81
7.3.180.0060.01116.45
7.3.170.0070.01016.39
7.3.160.0080.00716.71
7.2.330.0100.01016.79
7.2.320.0110.00816.94
7.2.310.0140.01016.61
7.2.300.0120.01216.82
7.2.290.0020.00716.50
7.2.00.0040.00719.34
7.1.100.0060.00618.04
7.1.70.0080.00317.11
7.1.60.0090.01519.32
7.1.50.0000.01517.09
7.1.00.0000.08022.31
7.0.200.0060.00316.95
7.0.140.0000.07722.04
7.0.70.5030.04319.91
7.0.60.0100.03319.94
7.0.50.0070.03717.79
7.0.40.0100.07720.05
7.0.30.0530.05320.00
7.0.20.0300.06320.17
7.0.10.0300.07720.04
7.0.00.0030.04320.09
5.6.280.0070.07021.09
5.6.210.0070.08320.74
5.6.200.0070.08018.19
5.6.190.0070.09020.60
5.6.180.0130.08020.61
5.6.170.0330.06020.54
5.6.160.0230.07020.50
5.6.150.0070.06318.18
5.6.140.0070.03718.11
5.6.130.0070.05718.18
5.6.120.0100.07720.98
5.6.110.0100.03720.98
5.6.100.0100.08321.08
5.6.90.0100.08320.97
5.6.80.0130.07320.48
5.6.70.0100.04720.27
5.5.350.0030.07020.40
5.5.340.0030.04017.96
5.5.330.0130.07720.36
5.5.320.0030.08320.29
5.5.310.0200.03720.29
5.5.300.0070.03717.98
5.5.290.0100.05718.00
5.5.280.0030.05720.83
5.5.270.0130.08320.72
5.5.260.0070.08020.84
5.5.250.0170.03320.59
5.5.240.0070.03320.27
5.4.450.3770.04019.37
5.4.440.0070.06019.48
5.4.430.1400.04319.47
5.4.420.2800.03719.22
5.4.410.1130.04019.32
5.4.400.1530.03319.18
5.4.390.1600.03319.05
5.4.380.2400.03319.16
5.4.370.1500.03318.96
5.4.360.0630.04019.15
5.4.350.2870.04319.04
5.4.340.3570.03718.96
5.4.320.4570.04019.06
5.4.310.2570.03319.16
5.4.300.3930.03719.15
5.4.290.3730.03718.99
5.4.280.3200.03719.06
5.4.270.4100.03318.89
5.4.260.3930.03719.05
5.4.250.3570.04019.12
5.4.240.4030.03318.96
5.4.230.4670.04719.03
5.4.220.4030.04019.09
5.4.210.4030.04319.20
5.4.200.4030.04018.99
5.4.190.0130.06718.85
5.4.180.0130.04319.11
5.4.170.3870.03019.12
5.4.160.4170.03319.02
5.4.150.4330.04319.14
5.4.140.4300.04016.49
5.4.130.4600.03016.26
5.4.120.3700.03716.34
5.4.110.3700.03316.62
5.4.100.4570.03016.51
5.4.90.3070.03716.38
5.4.80.0130.03716.52
5.4.70.4470.03016.38
5.4.60.3300.03316.33
5.4.50.4130.03716.33
5.4.40.2970.03316.32
5.4.30.3100.04016.10
5.4.20.4070.04016.32
5.4.10.4200.02716.52
5.4.00.4170.03315.88
5.3.290.4300.03014.54
5.3.280.4900.03014.69
5.3.270.3300.04314.43
5.3.260.4270.04014.50
5.3.250.3600.03714.54
5.3.240.3970.04014.53
5.3.230.4670.03314.53
5.3.220.3770.03714.58
5.3.210.3600.04014.49
5.3.200.4130.03714.50
5.3.190.0070.03714.58
5.3.180.0170.06314.53
5.3.170.3300.03014.49
5.3.160.4330.03314.46
5.3.150.3700.04014.49
5.3.140.4400.03714.43
5.3.130.3400.03714.47
5.3.120.3700.04014.47
5.3.110.3900.03314.52
5.3.100.3470.03313.97
5.3.90.3330.03713.84
5.3.80.3470.03313.95
5.3.70.3200.04013.93
5.3.60.4530.03013.82
5.3.50.3270.04313.79
5.3.40.3500.03313.79
5.3.30.3470.04013.86
5.3.20.4070.03713.51
5.3.10.3700.03713.58
5.3.00.3830.03713.61
5.2.170.3870.03011.13
5.2.160.3200.03311.00
5.2.150.2930.03011.02
5.2.140.3270.03311.08
5.2.130.3230.02711.04
5.2.120.3470.03010.93
5.2.110.3030.02010.99
5.2.100.2870.02711.18
5.2.90.3500.02711.19
5.2.80.3570.03011.09
5.2.70.3270.02711.08
5.2.60.3430.03011.03
5.2.50.2970.03711.10
5.2.40.2870.02710.90
5.2.30.2170.02710.86
5.2.20.2300.03010.96
5.2.10.2700.02310.87
5.2.00.3230.03010.74
5.1.60.3470.02310.00
5.1.50.2200.0209.97
5.1.40.3070.0239.95
5.1.30.3100.02710.37
5.1.20.2400.02710.36
5.1.10.1470.02010.05
5.1.00.1630.03310.05
5.0.50.1070.0278.54
5.0.40.0830.0208.41
5.0.30.0770.0278.29
5.0.20.0970.0178.10
5.0.10.0900.0238.16
5.0.00.0730.0308.13
4.4.90.1370.0136.22
4.4.80.1430.0136.22
4.4.70.1400.0176.22
4.4.60.1130.0136.22
4.4.50.1370.0136.22
4.4.40.1670.0276.22
4.4.30.1870.0136.22
4.4.20.0100.0206.22
4.4.10.1030.0136.22
4.4.00.0870.0236.22
4.3.110.0700.0176.22
4.3.100.0630.0136.22
4.3.90.1100.0176.22
4.3.80.0300.0236.22
4.3.70.1230.0176.22
4.3.60.0970.0176.22
4.3.50.1130.0176.22
4.3.40.1130.0136.22
4.3.30.0600.0176.22
4.3.20.0630.0136.22
4.3.10.0400.0176.22
4.3.00.0370.0136.22

preferences:
43.43 ms | 401 KiB | 5 Q