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->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)
5.4.340.0270.06719.05
5.4.320.0230.07319.08
5.4.310.0230.05319.09
5.4.300.0230.06319.08
5.4.290.0170.05018.98
5.4.280.0200.07319.26
5.4.270.0170.04319.16
5.4.260.0230.04019.09
5.4.250.0270.03319.07
5.4.240.0270.04719.08
5.4.230.0300.06019.15
5.4.220.0300.07019.16
5.4.210.0170.06319.16
5.4.200.0200.05718.87
5.4.190.0330.06319.21
5.4.180.0230.04719.07
5.4.170.0230.07319.07
5.4.160.0100.05019.20
5.4.150.0230.03319.14
5.4.140.0270.03716.51
5.4.130.0200.03316.45
5.4.120.0200.03716.51
5.4.110.0230.03316.61
5.4.100.0230.04016.54
5.4.90.0170.04316.56
5.4.80.0330.03016.54
5.4.70.0230.06716.44
5.4.60.0230.06716.54
5.4.50.0230.06716.42
5.4.40.0230.07716.58
5.4.30.0230.05016.48
5.4.20.0200.07716.55
5.4.10.0270.04716.56
5.4.00.0200.07015.80
5.3.290.0370.06314.63
5.3.280.0300.07314.43
5.3.270.0200.07714.54
5.3.260.0170.08014.46
5.3.250.0300.06714.56
5.3.240.0270.04714.45
5.3.230.0200.04314.45
5.3.220.0300.06314.52
5.3.210.0170.04714.53
5.3.200.0170.03714.55
5.3.190.0270.05714.43
5.3.180.0170.06314.44
5.3.170.0230.04014.59
5.3.160.0270.06714.43
5.3.150.0130.05014.60
5.3.140.0300.06314.59
5.3.130.0300.07314.40
5.3.120.0130.05714.43
5.3.110.0230.07314.53
5.3.100.0230.04314.09
5.3.90.0170.07713.93
5.3.80.0270.05313.86
5.3.70.0270.07013.92
5.3.60.0200.05713.84
5.3.50.0270.06714.00
5.3.40.0370.05713.74
5.3.30.0200.05313.77
5.3.20.0230.05313.78
5.3.10.0170.07013.59
5.3.00.0270.06713.52
5.2.170.0170.03012.59
5.2.160.0170.02712.59
5.2.150.0170.06012.59
5.2.140.0200.06012.59
5.2.130.0170.04312.59
5.2.120.0230.05312.59
5.2.110.0200.04312.59
5.2.100.0230.05312.59
5.2.90.0200.05712.59
5.2.80.0170.06312.59
5.2.70.0200.06012.59
5.2.60.0200.05012.59
5.2.50.0170.05712.59
5.2.40.0130.05012.59
5.2.30.0170.04312.59
5.2.20.0170.05012.59
5.2.10.0170.04312.59
5.2.00.0130.03012.59
5.1.60.0130.03012.59
5.1.50.0130.02712.59
5.1.40.0130.02712.59
5.1.30.0170.03712.59
5.1.20.0100.03012.59
5.1.10.0100.02712.59
5.1.00.0100.03012.59
5.0.50.0100.04712.59
5.0.40.0070.03312.59
5.0.30.0030.04712.59
5.0.20.0100.02312.59
5.0.10.0070.02312.59
5.0.00.0100.03312.59
4.4.90.0070.02312.59
4.4.80.0100.03012.59
4.4.70.0070.03312.59
4.4.60.0070.02712.59
4.4.50.0100.02012.59
4.4.40.0000.03012.59
4.4.30.0130.01312.59
4.4.20.0030.01712.59
4.4.10.0070.01712.59
4.4.00.0100.05012.59
4.3.110.0100.01712.59
4.3.100.0030.02312.59
4.3.90.0030.02312.59
4.3.80.0070.03012.59
4.3.70.0100.02012.59
4.3.60.0070.02712.59
4.3.50.0100.03012.59
4.3.40.0100.04712.59
4.3.30.0070.02712.59
4.3.20.0070.03312.59
4.3.10.0030.03312.59
4.3.00.0070.02712.59

preferences:
140.05 ms | 1394 KiB | 7 Q