3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $good =['name'=> 'prinsha','surname'=> 'jangam']; $good['doggy'] = 'newjippu'; //echo $good['name']; foreach($good as $key=>$item){ echo $key .' '.$item. "\n"; } $array = [1, 2, 3,4, 5] ; // Mulltidimensional array $dogs = [ ['breed' => 'Cocker Spaniel', 'name' => ' Jypsy', 'size' => [ 'width'=> 5, 'height'=> 10]], ['breed' => 'german ', 'name' => ' Jypsy', 'size' => [ 'width'=>5, 'height'=> 10]], ['breed' => 'Shiba Inu', 'name' => ' Kotetsu', 'size' => [ 'width'=> 5, 'height'=> 10]], ['breed' => 'Unknown', 'name' => ' Sheru Bahadur', 'size' => [ 'width'=>5, 'height'=> 10]], ]; echo $dogs[0]; // we can use this to represent record of any kind, for example student record, anything, even complex things
based on i7tF3
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
name prinsha surname jangam doggy newjippu Notice: Array to string conversion in /in/figZ1 on line 26 Array