3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $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 ', 'size' => [ 'width'=>5, 'height'=> 10]], ]; foreach($dogs as $key=>$item){ print_r $key . "= " . $item; } //echo '<div>' . $dogs[0]['name'] . '</div>'; ?>
based on FSlSR
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected '$key' (T_VARIABLE) in /in/tFlQs on line 17
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_VARIABLE in /in/tFlQs:17 Stack trace: #0 {main}
Process exited with code 255.