3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ids = array(); array_push($ids, array('case' => 1, 'foo' => 'zzz')); array_push($ids, array('case' => 3, 'foo' => 'qqq')); array_push($ids, array('case' => 4, 'foo' => 'xxx')); array_push($ids, array('case' => 5, 'foo' => 'kkk')); array_push($ids, array('case' => 6, 'foo' => 'sss')); $ids_list = ''; foreach($ids as $id) { $ids_list .= $ids['case'] . ','; } rtrim($ids_list, ','); echo $ids_list; ?>
based on kjCJT
Output for 5.6.0 - 7.3.0alpha1
Notice: Undefined index: case in /in/336bo on line 13 Notice: Undefined index: case in /in/336bo on line 13 Notice: Undefined index: case in /in/336bo on line 13 Notice: Undefined index: case in /in/336bo on line 13 Notice: Undefined index: case in /in/336bo on line 13 ,,,,,