3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startTime = strtotime('2013-01-01 3:00'); $finishTime = strtotime('2013-03-01 3:00'); $lastMonthDay = strtotime(sprintf('last day of Jan'), $startTime); $dateTime = strtotime(sprintf('%s %s %s', 'Mon', $startHM, $month), $startTime); for (;$dateTime <= $lastMonthDay, $dateTime <= $finishTime; $dateTime = strtotime('+1 week', $dateTime)) { echo date ('d-m-Y H:i'); }
Output for 5.0.4 - 5.0.5, 5.1.2 - 7.1.0
Notice: Undefined variable: startHM in /in/FHqIK on line 5 Notice: Undefined variable: month in /in/FHqIK on line 5 08-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:03
Output for 5.1.0 - 5.1.1
Notice: Undefined variable: startHM in /in/FHqIK on line 5 Notice: Undefined variable: month in /in/FHqIK on line 5 08-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:03
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: startHM in /in/FHqIK on line 5 Notice: Undefined variable: month in /in/FHqIK on line 5 08-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:0308-10-2013 13:03