3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dogs= [ ['name'=>'jippy','age'=>12 ,'address'=>'bhaktapur', 'size'=>[ 'weight'=>52, 'heght' =>2]], ['name'=>'jipu','age'=>2 ,'address'=>'pur', 'size'=>[ 'weight'=>52, 'heght' =>2]] ]; foreach($dogs as $key=> $item){ foreach($item as $innerkey=>$inneritem) { echo $innerkey . ' ' . $inneritem[$innerkey ]."\n"; } }
based on uRX1G
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.1
Warning: Illegal string offset 'name' in /in/2XTK2 on line 10 name j age Warning: Illegal string offset 'address' in /in/2XTK2 on line 10 address b Notice: Undefined index: size in /in/2XTK2 on line 10 size Warning: Illegal string offset 'name' in /in/2XTK2 on line 10 name j age Warning: Illegal string offset 'address' in /in/2XTK2 on line 10 address p Notice: Undefined index: size in /in/2XTK2 on line 10 size
Output for hhvm-3.15.4
name j age address b Notice: Undefined index: size in /in/2XTK2 on line 10 size name j age address p Notice: Undefined index: size in /in/2XTK2 on line 10 size