3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date1 = date_create('2014-07-19 13:00'); $date2 = date_create('2014-07-20 13:00'); $newArr = array(); while($date1 <= $date2) { $date1 = date_add($date1,date_interval_create_from_date_string('1 hour')); $newArr[] = date_format($date1, 'Y-m-d H:i:s'); } echo "<pre>"; print_r($newArr); echo "</pre>;
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in /in/XRvF2 on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /in/XRvF2 on line 13
Process exited with code 255.