3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date1 = '2014-07-19 13:00'; $date2 = '2014-07-20 13:00'; $arr = range(strtotime($date1), strtotime($date2), 3600); $date_range = array(); foreach ($arr as $a) $date_range[] = date('Y-m-d H:i:s', $a); print_r($date_range);
Output for 5.0.0 - 7.1.0
Array ( [0] => 2014-07-19 13:00:00 [1] => 2014-07-19 14:00:00 [2] => 2014-07-19 15:00:00 [3] => 2014-07-19 16:00:00 [4] => 2014-07-19 17:00:00 [5] => 2014-07-19 18:00:00 [6] => 2014-07-19 19:00:00 [7] => 2014-07-19 20:00:00 [8] => 2014-07-19 21:00:00 [9] => 2014-07-19 22:00:00 [10] => 2014-07-19 23:00:00 [11] => 2014-07-20 00:00:00 [12] => 2014-07-20 01:00:00 [13] => 2014-07-20 02:00:00 [14] => 2014-07-20 03:00:00 [15] => 2014-07-20 04:00:00 [16] => 2014-07-20 05:00:00 [17] => 2014-07-20 06:00:00 [18] => 2014-07-20 07:00:00 [19] => 2014-07-20 08:00:00 [20] => 2014-07-20 09:00:00 [21] => 2014-07-20 10:00:00 [22] => 2014-07-20 11:00:00 [23] => 2014-07-20 12:00:00 [24] => 2014-07-20 13:00:00 )
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
Warning: Wrong parameter count for range() in /in/bPiDD on line 6 Warning: Invalid argument supplied for foreach() in /in/bPiDD on line 9 Array ( )
Output for 4.3.11
Warning: Wrong parameter count for range() in /in/bPiDD on line 6 Array ( )