3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $keys = array('mesic', 'den', 'hodina'); $row = array('1988'); $hlp = &$row['1988']; foreach($keys as $key) { $hlp[$key] = array(); $hlp = &$hlp[$key]; } var_dump($row);
based on vfWF5
Output for 5.2.1 - 7.2.0
array(2) { [0]=> string(4) "1988" [1988]=> array(1) { ["mesic"]=> array(1) { ["den"]=> array(1) { ["hodina"]=> &array(0) { } } } } }
Output for 4.3.0 - 5.2.0
array(2) { [0]=> string(4) "1988" [1988]=> &array(1) { ["mesic"]=> &array(1) { ["den"]=> &array(1) { ["hodina"]=> &array(0) { } } } } }