3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $insert_doska['photos1'] = array(); $insert_doska['photos1'][1] = array('id' => $id_photo, 'order' => 1); var_dump($insert_doska); $phtos = array(); $phtos[1] = array('id' => $id_photo, 'order' => 1); $item['photos1'] = $phtos; var_dump($item['photos1']);
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: id_photo in /in/IlLFN on line 4 array(1) { ["photos1"]=> array(1) { [1]=> array(2) { ["id"]=> NULL ["order"]=> int(1) } } } Notice: Undefined variable: id_photo in /in/IlLFN on line 10 array(1) { [1]=> array(2) { ["id"]=> NULL ["order"]=> int(1) } }
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: id_photo in /in/IlLFN on line 4 array(1) { ["photos1"]=> array(1) { [1]=> array(2) { ["id"]=> NULL ["order"]=> int(1) } } } Notice: Undefined variable: id_photo in /in/IlLFN on line 10 array(1) { [1]=> array(2) { ["id"]=> NULL ["order"]=> int(1) } }