3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = strtotime('2014-09-15'); $end = strtotime('2014-11-15'); $stamp = $start; $months = array(); do { $next_stamp = min(mktime(0,0,0, date('n',$stamp)+1, 1, date('Y',$stamp)), $end); $months[] = date('Y-m-d H:i:s', $next_stamp)." ".date('Y-m-d H:i:s', $stamp).floor(($next_stamp-$stamp)/3600/24)/date('t', $stamp)." ".date('t', $stamp)." ".($next_stamp-$stamp); $stamp = $next_stamp; } while ($stamp <= $end); var_dump($months);
based on 7foHt
Output for 5.4.8, 5.4.10, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0

Process exited with code 137.
Output for 5.4.0 - 5.4.7, 5.4.9, 5.4.11 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/SBlkK on line 8
Process exited with code 255.