3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $items = array( array('id' => 1, 'date' > '2014-01-01'), array('id' => 2, 'date' > '2014-01-02'), array('id' => 3, 'date' > '2014-01-03'), array('id' => 4, 'date' > '2014-01-04'), array('id' => 5, 'date' > '2014-01-05'), array('id' => 6, 'date' > '2014-01-06'), array('id' => 7, 'date' > '2014-01-07'), ); foreach ($items as $item) { echo $item['date']; //Undefined index: date HUH? } var_dump($item); /* array(2) { ["id"]=> int(1) [0]=> bool(true) } */ // Ah!
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 array(2) { ["id"]=> int(7) [0]=> bool(true) }
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.2.17
Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 Notice: Undefined index: date in /in/Q8q6b on line 13 array(2) { ["id"]=> int(7) [0]=> bool(true) }
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Q8q6b on line 27
Process exited with code 255.