3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $result = array_reduce(range(25200, 68400, 900), function(&$cur, $x) { $cur[date('H:i', $x)] = date('g:ia', $x); return $cur; }, []); var_dump($result);
Output for 5.4.0 - 7.1.0
array(49) { ["08:00"]=> string(6) "8:00am" ["08:15"]=> string(6) "8:15am" ["08:30"]=> string(6) "8:30am" ["08:45"]=> string(6) "8:45am" ["09:00"]=> string(6) "9:00am" ["09:15"]=> string(6) "9:15am" ["09:30"]=> string(6) "9:30am" ["09:45"]=> string(6) "9:45am" ["10:00"]=> string(7) "10:00am" ["10:15"]=> string(7) "10:15am" ["10:30"]=> string(7) "10:30am" ["10:45"]=> string(7) "10:45am" ["11:00"]=> string(7) "11:00am" ["11:15"]=> string(7) "11:15am" ["11:30"]=> string(7) "11:30am" ["11:45"]=> string(7) "11:45am" ["12:00"]=> string(7) "12:00pm" ["12:15"]=> string(7) "12:15pm" ["12:30"]=> string(7) "12:30pm" ["12:45"]=> string(7) "12:45pm" ["13:00"]=> string(6) "1:00pm" ["13:15"]=> string(6) "1:15pm" ["13:30"]=> string(6) "1:30pm" ["13:45"]=> string(6) "1:45pm" ["14:00"]=> string(6) "2:00pm" ["14:15"]=> string(6) "2:15pm" ["14:30"]=> string(6) "2:30pm" ["14:45"]=> string(6) "2:45pm" ["15:00"]=> string(6) "3:00pm" ["15:15"]=> string(6) "3:15pm" ["15:30"]=> string(6) "3:30pm" ["15:45"]=> string(6) "3:45pm" ["16:00"]=> string(6) "4:00pm" ["16:15"]=> string(6) "4:15pm" ["16:30"]=> string(6) "4:30pm" ["16:45"]=> string(6) "4:45pm" ["17:00"]=> string(6) "5:00pm" ["17:15"]=> string(6) "5:15pm" ["17:30"]=> string(6) "5:30pm" ["17:45"]=> string(6) "5:45pm" ["18:00"]=> string(6) "6:00pm" ["18:15"]=> string(6) "6:15pm" ["18:30"]=> string(6) "6:30pm" ["18:45"]=> string(6) "6:45pm" ["19:00"]=> string(6) "7:00pm" ["19:15"]=> string(6) "7:15pm" ["19:30"]=> string(6) "7:30pm" ["19:45"]=> string(6) "7:45pm" ["20:00"]=> string(6) "8:00pm" }
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/JrTfA on line 7
Process exited with code 255.