3v4l.org

run code in 300+ PHP versions simultaneously
<?php $period = [ 'startDate' => new DateTime('2014/11/19'), 'endDate' => new DateTime('2015/2/01') ]; $fullTimeSpan = ($period['endDate']->getTimestamp()-$period['startDate']->getTimestamp())/(24*3600); $timeSpans = []; //hostelbookers can't handle updating more than 65 days in a row if ($fullTimeSpan <= $this->allowedTimeSpan) { $timeSpans[] = [ 'day' => $period['startDate']->format('d'), 'month' => $period['startDate']->format('n'), 'year' => $period['startDate']->format('Y'), 'timeSpan' => $fullTimeSpan ] } else { $startDate = new \DateTime(sprintf( '%s/%s/%s', $period['startDate']->format('Y'), $period['startDate']->format('n'), $period['startDate']->format('d'), )); $interval = new DateInterval(sprintf( 'P%dD', $this->allowedTimeSpan )); while ($fullTimeSpan > 0) { $timeSpans[] = [ 'day' => $startDate->format('d'), 'month' => $startDate->format('n'), 'year' => $startDate->format('Y'), 'timeSpan' => $fullTimeSpan <= $this->allowedTimeSpan ? $fullTimeSpan : $this->allowedTimeSpan ]; $fullTimeSpan -= $this->allowedTimeSpan; $startDate->add($interval); } } var_dump($timeSpans);

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.350.0120.03412.02
5.4.340.0110.03212.02
5.4.320.0070.04112.50
5.4.310.0070.04812.50
5.4.300.0080.04212.50
5.4.290.0090.04912.50
5.4.280.0070.03912.39
5.4.270.0070.03912.39
5.4.260.0070.04212.39
5.4.250.0110.05412.39
5.4.240.0050.04012.39
5.4.230.0050.04012.39
5.4.220.0080.03812.39
5.4.210.0050.04612.38
5.4.200.0060.04212.39
5.4.190.0060.03912.38
5.4.180.0040.04112.38
5.4.170.0070.03812.39
5.4.160.0080.04012.39
5.4.150.0060.03912.38
5.4.140.0090.04612.07
5.4.130.0130.03312.05
5.4.120.0070.04312.02
5.4.110.0140.05512.02
5.4.100.0070.04012.02
5.4.90.0080.04312.02
5.4.80.0070.04512.02
5.4.70.0100.04112.01
5.4.60.0120.04612.01
5.4.50.0110.05012.01
5.4.40.0060.03612.00
5.4.30.0080.03612.00
5.4.20.0070.03711.99
5.4.10.0060.03712.00
5.4.00.0050.03811.49
5.3.290.0130.03712.80
5.3.280.0040.04112.71
5.3.270.0040.04112.73
5.3.260.0070.04512.72
5.3.250.0100.04712.72
5.3.240.0070.04412.71
5.3.230.0070.04612.71
5.3.220.0120.03712.68
5.3.210.0100.05012.68
5.3.200.0090.03712.68
5.3.190.0130.03612.67
5.3.180.0070.04012.67
5.3.170.0110.03812.67
5.3.160.0060.04112.67
5.3.150.0100.03512.67
5.3.140.0070.04012.66
5.3.130.0080.04012.66
5.3.120.0080.03912.66
5.3.110.0050.04812.66
5.3.100.0080.03712.12
5.3.90.0060.04212.08
5.3.80.0060.04112.07
5.3.70.0110.04112.07
5.3.60.0070.03812.06
5.3.50.0090.03712.00
5.3.40.0070.03812.00
5.3.30.0070.03511.97
5.3.20.0070.03511.72
5.3.10.0080.03511.70
5.3.00.0040.03811.68
5.2.170.0090.0289.18
5.2.160.0040.0349.19
5.2.150.0040.0339.19
5.2.140.0070.0319.18
5.2.130.0090.0339.14
5.2.120.0040.0319.15
5.2.110.0090.0379.14
5.2.100.0050.0359.14
5.2.90.0060.0319.14
5.2.80.0070.0319.14
5.2.70.0050.0369.14
5.2.60.0040.0329.09
5.2.50.0050.0389.06
5.2.40.0050.0339.04
5.2.30.0060.0359.02
5.2.20.0070.0309.00
5.2.10.0040.0318.93
5.2.00.0050.0348.79
5.1.60.0040.0278.07
5.1.50.0080.0288.06
5.1.40.0050.0258.05
5.1.30.0040.0328.40
5.1.20.0060.0268.42
5.1.10.0030.0308.14
5.1.00.0030.0288.14
5.0.50.0040.0216.62
5.0.40.0070.0246.48
5.0.30.0060.0296.29
5.0.20.0040.0186.27
5.0.10.0020.0296.24
5.0.00.0050.0326.23
4.4.90.0070.0214.78
4.4.80.0040.0334.75
4.4.70.0050.0184.75
4.4.60.0040.0184.75
4.4.50.0080.0134.77
4.4.40.0030.0264.71
4.4.30.0030.0174.76
4.4.20.0030.0214.84
4.4.10.0060.0154.85
4.4.00.0040.0264.76
4.3.110.0020.0164.67
4.3.100.0040.0184.66
4.3.90.0050.0164.63
4.3.80.0010.0284.59
4.3.70.0050.0144.63
4.3.60.0030.0184.63
4.3.50.0030.0164.63
4.3.40.0030.0304.54
4.3.30.0020.0173.28
4.3.20.0050.0183.26
4.3.10.0030.0173.22
4.3.00.0070.0176.61

preferences:
143.06 ms | 1394 KiB | 7 Q