3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $nitins = ["firstName" => "Nitin", "lastName" => "sharma", "location" => "india", "job profile" => "shopOwner"]; $listOfnitin = []; foreach($nitins as $nitinKey => $nitinVal){ $details = [$nitinKey. " " . $nitinVal]; $listOfnitin = array_merge($listOfnitin, $details); } var_dump($listOfnitin);
based on XG0V8
Output for 5.6.38 - 7.3.1
array(4) { [0]=> string(16) "firstName Nitin" [1]=> string(16) "lastName sharma" [2]=> string(15) "location india" [3]=> string(22) "job profile shopOwner" }