3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(); $arr[1] = array('p' => 3, 'id' => 4); $arr[2] = array('p' => 2, 'id' => 3); $arr[3] = array('p' => 1, 'id' => 2); $arr[4] = array('p' => 0, 'id' => 1); $mas = array(); foreach($arr as $ind => $itm) { $mas[$itm['p']][$itm['id']]; }
Output for 5.3.0 - 7.1.0
Notice: Undefined offset: 3 in /in/4Ffbt on line 11 Notice: Undefined offset: 2 in /in/4Ffbt on line 11 Notice: Undefined offset: 1 in /in/4Ffbt on line 11 Notice: Undefined offset: 0 in /in/4Ffbt on line 11
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 3 in /in/4Ffbt on line 11 Notice: Undefined offset: 2 in /in/4Ffbt on line 11 Notice: Undefined offset: 1 in /in/4Ffbt on line 11 Notice: Undefined offset: 0 in /in/4Ffbt on line 11