3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateFrom = '2015/10/15'; $dateTo = '2015/12/31'; $lastDateList = array(); $fromFirstDay = strtotime('first day of ' . $dateFrom); while (end($lastDateList) < $dateTo) { $strYm = date('YYMM', $fromFirstDay); $ym = substr($strYm,0,4).'-'.substr($strYm,4,2); $dateLast = date('Y-m-d', strtotime('last day of ' . $ym)); $lastDateList[] = $dateLast; // 1ヶ月加算 $timeStampFrom = strtotime('+1 month', $fromFirstDay); }; echo($lastDateList); ?>
based on DudrQ
Output for 7.0.0 - 7.0.10, 7.1.0 - 7.2.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/7lWku on line 13
Process exited with code 255.
Output for 5.4.1 - 5.4.2, 5.4.6 - 5.4.11, 5.4.32, 5.4.45, 5.5.20, 5.5.23, 5.5.28, 5.5.31, 5.5.33 - 5.5.34, 5.5.36, 5.6.7, 5.6.13, 5.6.18, 5.6.21, 5.6.25 - 5.6.28, 7.0.20

Process exited with code 137.
Output for 5.4.12 - 5.4.14, 5.4.16 - 5.4.31, 5.4.34 - 5.4.44, 5.5.0 - 5.5.19, 5.5.21 - 5.5.22, 5.5.24 - 5.5.27, 5.5.29 - 5.5.30, 5.5.32, 5.5.35, 5.5.37 - 5.6.6, 5.6.8 - 5.6.12, 5.6.14 - 5.6.17, 5.6.19 - 5.6.20, 5.6.22 - 5.6.24
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/7lWku on line 11
Process exited with code 255.
Output for 5.4.15
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/7lWku on line 11
Process exited with code 137.
Output for 5.4.5
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 25 bytes) in /in/7lWku on line 13
Process exited with code 137.
Output for 5.4.0, 5.4.3 - 5.4.4
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 25 bytes) in /in/7lWku on line 13
Process exited with code 255.