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 = mktime(0,0,0, date('n',$stamp)+1, 1, date('Y',$stamp)); $next_stamp = min($next_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 SBlkK
Output for 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.1, 7.0.5, 7.0.9 - 7.1.0

Process exited with code 137.
Output for 7.0.2 - 7.0.4, 7.0.6 - 7.0.8
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554440 bytes) in /in/tRRUN on line 10
Process exited with code 255.
Output for 5.4.0 - 5.6.24
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/tRRUN on line 8
Process exited with code 255.